<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow, 1994-2006


Core pass to saturate constructors and PrimOps
-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns, CPP, MultiWayIf #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CoreToStg.Prep</span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#corePrepPgm"><span class="hs-identifier">corePrepPgm</span></a></span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#corePrepExpr"><span class="hs-identifier">corePrepExpr</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkConvertNumLiteral"><span class="hs-identifier">mkConvertNumLiteral</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html"><span class="hs-identifier">GHC.Core.Opt.OccurAnal</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.PrimOps.html"><span class="hs-identifier">GHC.Builtin.PrimOps</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html#realWorldStatePrimTy"><span class="hs-identifier">realWorldStatePrimTy</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html"><span class="hs-identifier">GHC.Types.Id.Make</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html#realWorldPrimId"><span class="hs-identifier">realWorldPrimId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html#mkPrimOpId"><span class="hs-identifier">mkPrimOpId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html"><span class="hs-identifier">GHC.Core.Opt.Arity</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html"><span class="hs-identifier">GHC.Core.Opt.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier">CoreToDo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html"><span class="hs-identifier">GHC.Core.Lint</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html#endPassIO"><span class="hs-identifier">endPassIO</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span> </span><span class="hs-keyword">hiding</span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Make.html#FloatBind"><span class="hs-identifier">FloatBind</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- We use our own FloatBind here</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html"><span class="hs-identifier">GHC.Core.TyCo.Rep</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCoProvenance"><span class="hs-identifier">UnivCoProvenance</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html"><span class="hs-identifier">GHC.Types.Demand</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Ways.html"><span class="hs-identifier">GHC.Driver.Ways</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#NamedThing"><span class="hs-identifier">NamedThing</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier">nameSrcSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#isInternalName"><span class="hs-identifier">isInternalName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier">SrcSpan</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#realSrcLocSpan"><span class="hs-identifier">realSrcLocSpan</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html"><span class="hs-identifier">GHC.Data.Pair</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier">mapAccumLM</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>        </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#"><span class="hs-identifier">Data.Functor.Identity</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier">CostCentre</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#ccFromThisModule"><span class="hs-identifier">ccFromThisModule</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">{-
-- ---------------------------------------------------------------------------
-- Note [CorePrep Overview]
-- ---------------------------------------------------------------------------

The goal of this pass is to prepare for code generation.

1.  Saturate constructor and primop applications.

2.  Convert to A-normal form; that is, function arguments
    are always variables.

    * Use case for strict arguments:
        f E ==&gt; case E of x -&gt; f x
        (where f is strict)

    * Use let for non-trivial lazy arguments
        f E ==&gt; let x = E in f x
        (were f is lazy and x is non-trivial)

3.  Similarly, convert any unboxed lets into cases.
    [I'm experimenting with leaving 'ok-for-speculation'
     rhss in let-form right up to this point.]

4.  Ensure that *value* lambdas only occur as the RHS of a binding
    (The code generator can't deal with anything else.)
    Type lambdas are ok, however, because the code gen discards them.

5.  [Not any more; nuked Jun 2002] Do the seq/par munging.

6.  Clone all local Ids.
    This means that all such Ids are unique, rather than the
    weaker guarantee of no clashes which the simplifier provides.
    And that is what the code generator needs.

    We don't clone TyVars or CoVars. The code gen doesn't need that,
    and doing so would be tiresome because then we'd need
    to substitute in types and coercions.

7.  Give each dynamic CCall occurrence a fresh unique; this is
    rather like the cloning step above.

8.  Inject bindings for the &quot;implicit&quot; Ids:
        * Constructor wrappers
        * Constructor workers
    We want curried definitions for all of these in case they
    aren't inlined by some caller.

9.  Replace (lazy e) by e.  See Note [lazyId magic] in GHC.Types.Id.Make
    Also replace (noinline e) by e.

10. Convert bignum literals (LitNatural and LitInteger) into their
    core representation.

11. Uphold tick consistency while doing this: We move ticks out of
    (non-type) applications where we can, and make sure that we
    annotate according to scoping rules when floating.

12. Collect cost centres (including cost centres in unfoldings) if we're in
    profiling mode. We have to do this here beucase we won't have unfoldings
    after this pass (see `zapUnfolding` and Note [Drop unfoldings and rules].

13. Eliminate case clutter in favour of unsafe coercions.
    See Note [Unsafe coercions]

14. Eliminate some magic Ids, specifically
     runRW# (\s. e)  ==&gt;  e[readWorldId/s]
             lazy e  ==&gt;  e
         noinline e  ==&gt;  e
     ToDo:  keepAlive# ...
    This is done in cpeApp

This is all done modulo type applications and abstractions, so that
when type erasure is done for conversion to STG, we don't end up with
any trivial or useless bindings.

Note [Unsafe coercions]
~~~~~~~~~~~~~~~~~~~~~~~
CorePrep does these two transformations:

* Convert empty case to cast with an unsafe coercion
          (case e of {}) ===&gt;  e |&gt; unsafe-co
  See Note [Empty case alternatives] in GHC.Core: if the case
  alternatives are empty, the scrutinee must diverge or raise an
  exception, so we can just dive into it.

  Of course, if the scrutinee *does* return, we may get a seg-fault.
  A belt-and-braces approach would be to persist empty-alternative
  cases to code generator, and put a return point anyway that calls a
  runtime system error function.

  Notice that eliminating empty case can lead to an ill-kinded coercion
      case error @Int &quot;foo&quot; of {}  :: Int#
      ===&gt; error @Int &quot;foo&quot; |&gt; unsafe-co
      where unsafe-co :: Int ~ Int#
  But that's fine because the expression diverges anyway. And it's
  no different to what happened before.

* Eliminate unsafeEqualityProof in favour of an unsafe coercion
          case unsafeEqualityProof of UnsafeRefl g -&gt; e
          ===&gt;  e[unsafe-co/g]
  See (U2) in Note [Implementing unsafeCoerce] in base:Unsafe.Coerce

  Note that this requiresuse ot substitute 'unsafe-co' for 'g', and
  that is the main (current) reason for cpe_tyco_env in CorePrepEnv.
  Tiresome, but not difficult.

These transformations get rid of &quot;case clutter&quot;, leaving only casts.
We are doing no further significant tranformations, so the reasons
for the case forms have disappeared. And it is extremely helpful for
the ANF-ery, CoreToStg, and backends, if trivial expressions really do
look trivial. #19700 was an example.

In both cases, the &quot;unsafe-co&quot; is just (UnivCo ty1 ty2 CorePrepProv).

Note [CorePrep invariants]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the syntax of the Core produced by CorePrep:

    Trivial expressions
       arg ::= lit |  var
              | arg ty  |  /\a. arg
              | truv co  |  /\c. arg  |  arg |&gt; co

    Applications
       app ::= lit  |  var  |  app arg  |  app ty  | app co | app |&gt; co

    Expressions
       body ::= app
              | let(rec) x = rhs in body     -- Boxed only
              | case body of pat -&gt; body
              | /\a. body | /\c. body
              | body |&gt; co

    Right hand sides (only place where value lambdas can occur)
       rhs ::= /\a.rhs  |  \x.rhs  |  body

We define a synonym for each of these non-terminals.  Functions
with the corresponding name produce a result in that syntax.
-}</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-keyword">type</span><span> </span><span id="CpeArg"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeArg"><span class="hs-identifier hs-var">CpeArg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- Non-terminal 'arg'</span><span>
</span><span id="line-216"></span><span class="hs-keyword">type</span><span> </span><span id="CpeApp"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-var">CpeApp</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- Non-terminal 'app'</span><span>
</span><span id="line-217"></span><span class="hs-keyword">type</span><span> </span><span id="CpeBody"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-var">CpeBody</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- Non-terminal 'body'</span><span>
</span><span id="line-218"></span><span class="hs-keyword">type</span><span> </span><span id="CpeRhs"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-var">CpeRhs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>    </span><span class="hs-comment">-- Non-terminal 'rhs'</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Top level stuff
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#corePrepPgm"><span class="hs-identifier hs-type">corePrepPgm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-229"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">S.Set</span></a></span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span id="corePrepPgm"><span class="annot"><span class="annottext">corePrepPgm :: HscEnv
-&gt; Module
-&gt; ModLocation
-&gt; CoreProgram
-&gt; [TyCon]
-&gt; IO (CoreProgram, Set CostCentre)
</span><a href="GHC.CoreToStg.Prep.html#corePrepPgm"><span class="hs-identifier hs-var hs-var">corePrepPgm</span></a></span></span><span> </span><span id="local-6989586621681190046"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190046"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681190045"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190045"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span id="local-6989586621681190044"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681190044"><span class="hs-identifier hs-var">mod_loc</span></a></span></span><span> </span><span id="local-6989586621681190043"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190043"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621681190042"><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681190042"><span class="hs-identifier hs-var">data_tycons</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-231"></span><span>    </span><span class="annot"><span class="annottext">DynFlags
-&gt; SDoc
-&gt; ((CoreProgram, Set CostCentre) -&gt; ())
-&gt; IO (CoreProgram, Set CostCentre)
-&gt; IO (CoreProgram, Set CostCentre)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190040"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-232"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CorePrep&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190045"><span class="hs-identifier hs-var">this_mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; (CoreProgram, Set CostCentre) -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO (CoreProgram, Set CostCentre)
 -&gt; IO (CoreProgram, Set CostCentre))
-&gt; IO (CoreProgram, Set CostCentre)
-&gt; IO (CoreProgram, Set CostCentre)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-234"></span><span>    </span><span id="local-6989586621681190034"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190034"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'s'</span></span><span>
</span><span id="line-235"></span><span>    </span><span id="local-6989586621681190032"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681190032"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#mkInitialCorePrepEnv"><span class="hs-identifier hs-var">mkInitialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190046"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-236"></span><span>
</span><span id="line-237"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190028"><span class="annot"><span class="annottext">cost_centres :: Set CostCentre
</span><a href="#local-6989586621681190028"><span class="hs-identifier hs-var hs-var">cost_centres</span></a></span></span><span>
</span><span id="line-238"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Way
</span><a href="GHC.Driver.Ways.html#WayProf"><span class="hs-identifier hs-var">WayProf</span></a></span><span> </span><span class="annot"><span class="annottext">Way -&gt; Set Way -&gt; Bool
forall a. Ord a =&gt; a -&gt; Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#member"><span class="hs-operator hs-var">`S.member`</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190040"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-239"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; CoreProgram -&gt; Set CostCentre
</span><a href="GHC.CoreToStg.Prep.html#collectCostCentres"><span class="hs-identifier hs-var">collectCostCentres</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190045"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190043"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-240"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-241"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">S.empty</span></a></span><span>
</span><span id="line-242"></span><span>
</span><span id="line-243"></span><span>        </span><span id="local-6989586621681190022"><span class="annot"><span class="annottext">implicit_binds :: CoreProgram
</span><a href="#local-6989586621681190022"><span class="hs-identifier hs-var hs-var">implicit_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModLocation -&gt; [TyCon] -&gt; CoreProgram
</span><a href="GHC.CoreToStg.Prep.html#mkDataConWorkers"><span class="hs-identifier hs-var">mkDataConWorkers</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190040"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681190044"><span class="hs-identifier hs-var">mod_loc</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681190042"><span class="hs-identifier hs-var">data_tycons</span></a></span><span>
</span><span id="line-244"></span><span>            </span><span class="hs-comment">-- NB: we must feed mkImplicitBinds through corePrep too</span><span>
</span><span id="line-245"></span><span>            </span><span class="hs-comment">-- so that they are suitably cloned and eta-expanded</span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span>        </span><span id="local-6989586621681190017"><span class="annot"><span class="annottext">binds_out :: CoreProgram
</span><a href="#local-6989586621681190017"><span class="hs-identifier hs-var hs-var">binds_out</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; UniqSM CoreProgram -&gt; CoreProgram
forall a. UniqSupply -&gt; UniqSM a -&gt; a
</span><a href="GHC.Types.Unique.Supply.html#initUs_"><span class="hs-identifier hs-var">initUs_</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190034"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqSM CoreProgram -&gt; CoreProgram)
-&gt; UniqSM CoreProgram -&gt; CoreProgram
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-248"></span><span>                      </span><span id="local-6989586621681190015"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681190015"><span class="hs-identifier hs-var">floats1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="GHC.CoreToStg.Prep.html#corePrepTopBinds"><span class="hs-identifier hs-var">corePrepTopBinds</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681190032"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190043"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-249"></span><span>                      </span><span id="local-6989586621681190013"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681190013"><span class="hs-identifier hs-var">floats2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="GHC.CoreToStg.Prep.html#corePrepTopBinds"><span class="hs-identifier hs-var">corePrepTopBinds</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681190032"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190022"><span class="hs-identifier hs-var">implicit_binds</span></a></span><span>
</span><span id="line-250"></span><span>                      </span><span class="annot"><span class="annottext">CoreProgram -&gt; UniqSM CoreProgram
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats -&gt; CoreProgram
</span><a href="GHC.CoreToStg.Prep.html#deFloatTop"><span class="hs-identifier hs-var">deFloatTop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681190015"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681190013"><span class="hs-identifier hs-var">floats2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span>    </span><span class="annot"><span class="annottext">HscEnv
-&gt; PrintUnqualified
-&gt; CoreToDo
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Lint.html#endPassIO"><span class="hs-identifier hs-var">endPassIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190046"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier hs-var">alwaysQualify</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CorePrep"><span class="hs-identifier hs-var">CorePrep</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190017"><span class="hs-identifier hs-var">binds_out</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-253"></span><span>    </span><span class="annot"><span class="annottext">(CoreProgram, Set CostCentre) -&gt; IO (CoreProgram, Set CostCentre)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190017"><span class="hs-identifier hs-var">binds_out</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681190028"><span class="hs-identifier hs-var">cost_centres</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-255"></span><span>    </span><span id="local-6989586621681190040"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681190040"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190046"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#corePrepExpr"><span class="hs-identifier hs-type">corePrepExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-258"></span><span id="corePrepExpr"><span class="annot"><span class="annottext">corePrepExpr :: HscEnv -&gt; CpeRhs -&gt; IO CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#corePrepExpr"><span class="hs-identifier hs-var hs-var">corePrepExpr</span></a></span></span><span> </span><span id="local-6989586621681190007"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190007"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681190006"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681190006"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-259"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190005"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681190005"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190007"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-260"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; (CpeRhs -&gt; ()) -&gt; IO CpeRhs -&gt; IO CpeRhs
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190005"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CorePrep [expr]&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; CpeRhs -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO CpeRhs -&gt; IO CpeRhs) -&gt; IO CpeRhs -&gt; IO CpeRhs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-261"></span><span>      </span><span id="local-6989586621681190004"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190004"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'s'</span></span><span>
</span><span id="line-262"></span><span>      </span><span id="local-6989586621681190003"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681190003"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#mkInitialCorePrepEnv"><span class="hs-identifier hs-var">mkInitialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190007"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-263"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190002"><span class="annot"><span class="annottext">new_expr :: CpeRhs
</span><a href="#local-6989586621681190002"><span class="hs-identifier hs-var hs-var">new_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; UniqSM CpeRhs -&gt; CpeRhs
forall a. UniqSupply -&gt; UniqSM a -&gt; a
</span><a href="GHC.Types.Unique.Supply.html#initUs_"><span class="hs-identifier hs-var">initUs_</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190004"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var">cpeBodyNF</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681190003"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681190006"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span>      </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190005"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_prep"><span class="hs-identifier hs-var">Opt_D_dump_prep</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;CorePrep&quot;</span></span><span> </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681190002"><span class="hs-identifier hs-var">new_expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>      </span><span class="annot"><span class="annottext">CpeRhs -&gt; IO CpeRhs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681190002"><span class="hs-identifier hs-var">new_expr</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#corePrepTopBinds"><span class="hs-identifier hs-type">corePrepTopBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- Note [Floating out of top level bindings]</span><span>
</span><span id="line-269"></span><span id="corePrepTopBinds"><span class="annot"><span class="annottext">corePrepTopBinds :: CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="GHC.CoreToStg.Prep.html#corePrepTopBinds"><span class="hs-identifier hs-var hs-var">corePrepTopBinds</span></a></span></span><span> </span><span id="local-6989586621681189997"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189997"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span></span><span> </span><span id="local-6989586621681189996"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189996"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="#local-6989586621681189995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189997"><span class="hs-identifier hs-var">initialCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189996"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-271"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-272"></span><span>    </span><span id="local-6989586621681189995"><span class="annot"><span class="annottext">go :: CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="#local-6989586621681189995"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">[</span><span class="hs-special">]</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; UniqSM Floats
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span>
</span><span id="line-273"></span><span>    </span><span class="annot"><a href="#local-6989586621681189995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681189987"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189987"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189986"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189986"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189985"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189985"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189984"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189984"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189983"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189983"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189982"><span class="annot"><span class="annottext">Maybe CoreBind
</span><a href="#local-6989586621681189982"><span class="hs-identifier hs-var">maybe_new_bind</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>                                 </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; CorePrepEnv
-&gt; CoreBind
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
</span><a href="GHC.CoreToStg.Prep.html#cpeBind"><span class="hs-identifier hs-var">cpeBind</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="GHC.Types.Basic.html#TopLevel"><span class="hs-identifier hs-var">TopLevel</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189987"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189986"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-275"></span><span>                               </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isNothing</span><span> </span><span class="hs-identifier">maybe_new_bind</span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>                                 </span><span class="hs-comment">-- Only join points get returned this way by</span><span>
</span><span id="line-277"></span><span>                                 </span><span class="hs-comment">-- cpeBind, and no join point may float to top</span><span>
</span><span id="line-278"></span><span>                               </span><span id="local-6989586621681189974"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189974"><span class="hs-identifier hs-var">floatss</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CoreProgram -&gt; UniqSM Floats
</span><a href="#local-6989586621681189995"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189984"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189985"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-279"></span><span>                               </span><span class="annot"><span class="annottext">Floats -&gt; UniqSM Floats
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189983"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189974"><span class="hs-identifier hs-var">floatss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkDataConWorkers"><span class="hs-identifier hs-type">mkDataConWorkers</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-282"></span><span class="hs-comment">-- See Note [Data constructor workers]</span><span>
</span><span id="line-283"></span><span class="hs-comment">-- c.f. Note [Injecting implicit bindings] in GHC.Iface.Tidy</span><span>
</span><span id="line-284"></span><span id="mkDataConWorkers"><span class="annot"><span class="annottext">mkDataConWorkers :: DynFlags -&gt; ModLocation -&gt; [TyCon] -&gt; CoreProgram
</span><a href="GHC.CoreToStg.Prep.html#mkDataConWorkers"><span class="hs-identifier hs-var hs-var">mkDataConWorkers</span></a></span></span><span> </span><span id="local-6989586621681189973"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189973"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681189972"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681189972"><span class="hs-identifier hs-var">mod_loc</span></a></span></span><span> </span><span id="local-6989586621681189971"><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681189971"><span class="hs-identifier hs-var">data_tycons</span></a></span></span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189969"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; CpeRhs -&gt; CpeRhs
forall {b}. Name -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189968"><span class="hs-identifier hs-var">tick_it</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681189966"><span class="hs-identifier hs-var">data_con</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189969"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>                                </span><span class="hs-comment">-- The ice is thin here, but it works</span><span>
</span><span id="line-287"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681189964"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681189964"><span class="hs-identifier hs-var">tycon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyCon]
</span><a href="#local-6989586621681189971"><span class="hs-identifier hs-var">data_tycons</span></a></span><span class="hs-special">,</span><span>     </span><span class="hs-comment">-- CorePrep will eta-expand it</span><span>
</span><span id="line-288"></span><span>      </span><span id="local-6989586621681189966"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681189966"><span class="hs-identifier hs-var">data_con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [DataCon]
</span><a href="GHC.Core.TyCon.html#tyConDataCons"><span class="hs-identifier hs-var">tyConDataCons</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681189964"><span class="hs-identifier hs-var">tycon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-289"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189969"><span class="annot"><span class="annottext">id :: Id
</span><a href="#local-6989586621681189969"><span class="hs-identifier hs-var hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Id
</span><a href="GHC.Core.DataCon.html#dataConWorkId"><span class="hs-identifier hs-var">dataConWorkId</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681189966"><span class="hs-identifier hs-var">data_con</span></a></span><span>
</span><span id="line-290"></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-291"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-292"></span><span>   </span><span class="hs-comment">-- If we want to generate debug info, we put a source note on the</span><span>
</span><span id="line-293"></span><span>   </span><span class="hs-comment">-- worker. This is useful, especially for heap profiling.</span><span>
</span><span id="line-294"></span><span>   </span><span id="local-6989586621681189968"><span class="annot"><span class="annottext">tick_it :: Name -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189968"><span class="hs-identifier hs-var hs-var">tick_it</span></a></span></span><span> </span><span id="local-6989586621681189959"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681189959"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-295"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#debugLevel"><span class="hs-identifier hs-var hs-var">debugLevel</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189973"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Expr b -&gt; Expr b
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-296"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621681189955"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681189955"><span class="hs-identifier hs-var">span</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681189959"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Expr b -&gt; Expr b
forall {b}. RealSrcSpan -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189954"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681189955"><span class="hs-identifier hs-var">span</span></a></span><span>
</span><span id="line-297"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189953"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681189953"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe String
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681189972"><span class="hs-identifier hs-var">mod_loc</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Expr b -&gt; Expr b
forall {b}. RealSrcSpan -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189954"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; RealSrcSpan
</span><a href="#local-6989586621681189951"><span class="hs-identifier hs-var">span1</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681189953"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Expr b -&gt; Expr b
forall {b}. RealSrcSpan -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189954"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; RealSrcSpan
</span><a href="#local-6989586621681189951"><span class="hs-identifier hs-var">span1</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;???&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681189954"><span class="annot"><span class="annottext">tick :: RealSrcSpan -&gt; Expr b -&gt; Expr b
</span><a href="#local-6989586621681189954"><span class="hs-identifier hs-var hs-var">tick</span></a></span></span><span> </span><span id="local-6989586621681189948"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681189948"><span class="hs-identifier hs-var">span</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Expr b -&gt; Expr b
forall b. Tickish Id -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-var">Tick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcSpan -&gt; String -&gt; Tickish Id
forall id. RealSrcSpan -&gt; String -&gt; Tickish id
</span><a href="GHC.Core.html#SourceNote"><span class="hs-identifier hs-var">SourceNote</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681189948"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Tickish Id) -&gt; String -&gt; Tickish Id
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; String
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189973"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681189959"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>           </span><span id="local-6989586621681189951"><span class="annot"><span class="annottext">span1 :: String -&gt; RealSrcSpan
</span><a href="#local-6989586621681189951"><span class="hs-identifier hs-var hs-var">span1</span></a></span></span><span> </span><span id="local-6989586621681189944"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681189944"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RealSrcLoc -&gt; RealSrcSpan
</span><a href="GHC.Types.SrcLoc.html#realSrcLocSpan"><span class="hs-identifier hs-var">realSrcLocSpan</span></a></span><span> </span><span class="annot"><span class="annottext">(RealSrcLoc -&gt; RealSrcSpan) -&gt; RealSrcLoc -&gt; RealSrcSpan
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681189944"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="hs-comment">{-
Note [Floating out of top level bindings]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NB: we do need to float out of top-level bindings
Consider        x = length [True,False]
We want to get
                s1 = False : []
                s2 = True  : s1
                x  = length s2

We return a *list* of bindings, because we may start with
        x* = f (g y)
where x is demanded, in which case we want to finish with
        a = g y
        x* = f a
And then x will actually end up case-bound

Note [Join points and floating]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Join points can float out of other join points but not out of value bindings:

  let z =
    let  w = ... in -- can float
    join k = ... in -- can't float
    ... jump k ...
  join j x1 ... xn =
    let  y = ... in -- can float (but don't want to)
    join h = ... in -- can float (but not much point)
    ... jump h ...
  in ...

Here, the jump to h remains valid if h is floated outward, but the jump to k
does not.

We don't float *out* of join points. It would only be safe to float out of
nullary join points (or ones where the arguments are all either type arguments
or dead binders). Nullary join points aren't ever recursive, so they're always
effectively one-shot functions, which we don't float out of. We *could* float
join points from nullary join points, but there's no clear benefit at this
stage.

Note [Data constructor workers]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create any necessary &quot;implicit&quot; bindings for data con workers.  We
create the rather strange (non-recursive!) binding

        $wC = \x y -&gt; $wC x y

i.e. a curried constructor that allocates.  This means that we can
treat the worker for a constructor like any other function in the rest
of the compiler.  The point here is that CoreToStg will generate a
StgConApp for the RHS, rather than a call to the worker (which would
give a loop).  As Lennart says: the ice is thin here, but it works.

Hmm.  Should we create bindings for dictionary constructors?  They are
always fully applied, and the bindings are just there to support
partial applications. But it's easier to let them through.


Note [Dead code in CorePrep]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Imagine that we got an input program like this (see #4962):

  f :: Show b =&gt; Int -&gt; (Int, b -&gt; Maybe Int -&gt; Int)
  f x = (g True (Just x) + g () (Just x), g)
    where
      g :: Show a =&gt; a -&gt; Maybe Int -&gt; Int
      g _ Nothing = x
      g y (Just z) = if z &gt; 100 then g y (Just (z + length (show y))) else g y unknown

After specialisation and SpecConstr, we would get something like this:

  f :: Show b =&gt; Int -&gt; (Int, b -&gt; Maybe Int -&gt; Int)
  f x = (g$Bool_True_Just x + g$Unit_Unit_Just x, g)
    where
      {-# RULES g $dBool = g$Bool
                g $dUnit = g$Unit #-}
      g = ...
      {-# RULES forall x. g$Bool True (Just x) = g$Bool_True_Just x #-}
      g$Bool = ...
      {-# RULES forall x. g$Unit () (Just x) = g$Unit_Unit_Just x #-}
      g$Unit = ...
      g$Bool_True_Just = ...
      g$Unit_Unit_Just = ...

Note that the g$Bool and g$Unit functions are actually dead code: they
are only kept alive by the occurrence analyser because they are
referred to by the rules of g, which is being kept alive by the fact
that it is used (unspecialised) in the returned pair.

However, at the CorePrep stage there is no way that the rules for g
will ever fire, and it really seems like a shame to produce an output
program that goes to the trouble of allocating a closure for the
unreachable g$Bool and g$Unit functions.

The way we fix this is to:
 * In cloneBndr, drop all unfoldings/rules

 * In deFloatTop, run a simple dead code analyser on each top-level
   RHS to drop the dead local bindings.

The reason we don't just OccAnal the whole output of CorePrep is that
the tidier ensures that all top-level binders are GlobalIds, so they
don't show up in the free variables any longer. So if you run the
occurrence analyser on the output of CoreTidy (or later) you e.g. turn
this program:

  Rec {
  f = ... f ...
  }

Into this one:

  f = ... f ...

(Since f is not considered to be free in its own RHS.)


Note [keepAlive# magic]
~~~~~~~~~~~~~~~~~~~~~~~
When interacting with foreign code, it is often necessary for the user to
extend the lifetime of a heap object beyond the lifetime that would be apparent
from the on-heap references alone. For instance, a program like:

  foreign import safe &quot;hello&quot; hello :: ByteArray# -&gt; IO ()

  callForeign :: IO ()
  callForeign = IO $ \s0 -&gt;
    case newByteArray# n# s0 of (# s1, barr #) -&gt;
      unIO hello barr s1

As-written this program is susceptible to memory-unsafety since there are
no references to `barr` visible to the garbage collector. Consequently, if a
garbage collection happens during the execution of the C function `hello`, it
may be that the array is freed while in use by the foreign function.

To address this, we introduced a new primop, keepAlive#, which &quot;scopes over&quot;
the computation needing the kept-alive value:

  keepAlive# :: forall (ra :: RuntimeRep) (rb :: RuntimeRep) (a :: TYPE a) (b :: TYPE b).
                a -&gt; State# RealWorld -&gt; (State# RealWorld -&gt; b) -&gt; b

When entered, an application (keepAlive# x s k) will apply `k` to the state
token, evaluating it to WHNF. However, during the course of this evaluation
will *guarantee* that `x` is considered to be alive.

There are a few things to note here:

 - we are RuntimeRep-polymorphic in the value to be kept-alive. This is
   necessary since we will often (but not always) be keeping alive something
   unlifted (like a ByteArray#)

 - we are RuntimeRep-polymorphic in the result value since the result may take
   many forms (e.g. a boxed value, a raw state token, or a (# State s, result #).

We implement this operation by desugaring to touch# during CorePrep (see
GHC.CoreToStg.Prep.cpeApp). Specifically,

  keepAlive# x s0 k

is transformed to:

  case k s0 of r -&gt;
  case touch# x realWorld# of s1 -&gt;
    r

Operationally, `keepAlive# x s k` is equivalent to pushing a stack frame with a
pointer to `x` and entering `k s0`. This compilation strategy is safe
because we do no optimization on STG that would drop or re-order the
continuation containing the `touch#`. However, if we were to become more
aggressive in our STG pipeline then we would need to revisit this.

Beyond this CorePrep transformation, there is very little special about
keepAlive#. However, we did explore (and eventually gave up on)
an optimisation which would allow unboxing of constructed product results,
which we describe below.


Lost optimisation: CPR unboxing
--------------------------------
One unfortunate property of this approach is that the simplifier is unable to
unbox the result of a keepAlive# expression. For instance, consider the program:

  case keepAlive# arr s0 (
         \s1 -&gt; case peekInt arr s1 of
                  (# s2, r #) -&gt; I# r
  ) of
    I# x -&gt; ...

This is a surprisingly common pattern, previously used, e.g., in
GHC.IO.Buffer.readWord8Buf. While exploring ideas, we briefly played around
with optimising this away by pushing strict contexts (like the
`case [] of I# x -&gt; ...` above) into keepAlive#'s continuation. While this can
recover unboxing, it can also unfortunately in general change the asymptotic
memory (namely stack) behavior of the program. For instance, consider

  writeN =
    ...
      case keepAlive# x s0 (\s1 -&gt; something s1) of
        (# s2, x #) -&gt;
          writeN ...

As it is tail-recursive, this program will run in constant space. However, if
we push outer case into the continuation we get:

  writeN =

      case keepAlive# x s0 (\s1 -&gt;
        case something s1 of
          (# s2, x #) -&gt;
            writeN ...
      ) of
        ...

Which ends up building a stack which is linear in the recursion depth. For this
reason, we ended up giving up on this optimisation.


Historical note: touch# and its inadequacy
------------------------------------------
Prior to the introduction of `keepAlive#` we instead addressed the need for
lifetime extension with the `touch#` primop:

    touch# :: a -&gt; State# s -&gt; State# s

This operation would ensure that the `a` value passed as the first argument was
considered &quot;alive&quot; at the time the primop application is entered.

For instance, the user might modify `callForeign` as:

  callForeign :: IO ()
  callForeign s0 = IO $ \s0 -&gt;
    case newByteArray# n# s0 of (# s1, barr #) -&gt;
    case unIO hello barr s1 of (# s2, () #) -&gt;
    case touch# barr s2 of s3 -&gt;
      (# s3, () #)

However, in #14346 we discovered that this primop is insufficient in the
presence of simplification. For instance, consider a program like:

  callForeign :: IO ()
  callForeign s0 = IO $ \s0 -&gt;
    case newByteArray# n# s0 of (# s1, barr #) -&gt;
    case unIO (forever $ hello barr) s1 of (# s2, () #) -&gt;
    case touch# barr s2 of s3 -&gt;
      (# s3, () #)

In this case the Simplifier may realize that (forever $ hello barr)
will never return and consequently that the `touch#` that follows is dead code.
As such, it will be dropped, resulting in memory unsoundness.
This unsoundness lead to the introduction of keepAlive#.



Other related tickets:

 - #15544
 - #17760
 - #14375
 - #15260
 - #18061

************************************************************************
*                                                                      *
                The main code
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-570"></span><span>
</span><span id="line-571"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeBind"><span class="hs-identifier hs-type">cpeBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span>
</span><span id="line-572"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-573"></span><span>                   </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- Floating value bindings</span><span>
</span><span id="line-574"></span><span>                   </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Just bind' &lt;=&gt; returned new bind; no float</span><span>
</span><span id="line-575"></span><span>                                   </span><span class="hs-comment">-- Nothing &lt;=&gt; added bind' to floats instead</span><span>
</span><span id="line-576"></span><span id="cpeBind"><span class="annot"><span class="annottext">cpeBind :: TopLevelFlag
-&gt; CorePrepEnv
-&gt; CoreBind
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
</span><a href="GHC.CoreToStg.Prep.html#cpeBind"><span class="hs-identifier hs-var hs-var">cpeBind</span></a></span></span><span> </span><span id="local-6989586621681189942"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189942"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span> </span><span id="local-6989586621681189941"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681189940"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189939"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189939"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isJoinId"><span class="hs-identifier hs-var">isJoinId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189937"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189937"><span class="hs-identifier hs-var">env1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189936"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189936"><span class="hs-identifier hs-var">bndr1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-var">cpCloneBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-579"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189934"><span class="annot"><span class="annottext">dmd :: Demand
</span><a href="#local-6989586621681189934"><span class="hs-identifier hs-var hs-var">dmd</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Demand
</span><a href="GHC.Types.Id.html#idDemandInfo"><span class="hs-identifier hs-var">idDemandInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-580"></span><span>             </span><span id="local-6989586621681189930"><span class="annot"><span class="annottext">is_unlifted :: Bool
</span><a href="#local-6989586621681189930"><span class="hs-identifier hs-var hs-var">is_unlifted</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Bool
Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnliftedType"><span class="hs-identifier hs-var">isUnliftedType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189927"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189927"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189926"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189926"><span class="hs-identifier hs-var">rhs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; RecFlag
-&gt; Demand
-&gt; Bool
-&gt; CorePrepEnv
-&gt; Id
-&gt; CpeRhs
-&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpePair"><span class="hs-identifier hs-var">cpePair</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189942"><span class="hs-identifier hs-var">top_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span>
</span><span id="line-582"></span><span>                                   </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189934"><span class="hs-identifier hs-var">dmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189930"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span>
</span><span id="line-583"></span><span>                                   </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189936"><span class="hs-identifier hs-var">bndr1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189939"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-584"></span><span>       </span><span class="hs-comment">-- See Note [Inlining in CorePrep]</span><span>
</span><span id="line-585"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189923"><span class="annot"><span class="annottext">triv_rhs :: Bool
</span><a href="#local-6989586621681189923"><span class="hs-identifier hs-var hs-var">triv_rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsTrivial"><span class="hs-identifier hs-var">exprIsTrivial</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189926"><span class="hs-identifier hs-var">rhs1</span></a></span><span>
</span><span id="line-586"></span><span>             </span><span id="local-6989586621681189921"><span class="annot"><span class="annottext">env2 :: CorePrepEnv
</span><a href="#local-6989586621681189921"><span class="hs-identifier hs-var hs-var">env2</span></a></span></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189923"><span class="hs-identifier hs-var">triv_rhs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvExpr"><span class="hs-identifier hs-var">extendCorePrepEnvExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189937"><span class="hs-identifier hs-var">env1</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189926"><span class="hs-identifier hs-var">rhs1</span></a></span><span>
</span><span id="line-587"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189937"><span class="hs-identifier hs-var">env1</span></a></span><span>
</span><span id="line-588"></span><span>             </span><span id="local-6989586621681189919"><span class="annot"><span class="annottext">floats1 :: Floats
</span><a href="#local-6989586621681189919"><span class="hs-identifier hs-var hs-var">floats1</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189923"><span class="hs-identifier hs-var">triv_rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isInternalName"><span class="hs-identifier hs-var">isInternalName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189927"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-590"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-591"></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var">addFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189927"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189916"><span class="hs-identifier hs-var">new_float</span></a></span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span>             </span><span id="local-6989586621681189916"><span class="annot"><span class="annottext">new_float :: FloatingBind
</span><a href="#local-6989586621681189916"><span class="hs-identifier hs-var hs-var">new_float</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Demand -&gt; Bool -&gt; Id -&gt; CpeRhs -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#mkFloat"><span class="hs-identifier hs-var">mkFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189934"><span class="hs-identifier hs-var">dmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189930"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189936"><span class="hs-identifier hs-var">bndr1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189926"><span class="hs-identifier hs-var">rhs1</span></a></span><span>
</span><span id="line-594"></span><span>
</span><span id="line-595"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Floats, Maybe CoreBind)
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189921"><span class="hs-identifier hs-var">env2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189919"><span class="hs-identifier hs-var">floats1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe CoreBind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-comment">-- A join point; see Note [Join points and floating]</span><span>
</span><span id="line-598"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isTopLevel</span><span> </span><span class="hs-identifier">top_lvl</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- can't have top-level join point</span><span>
</span><span id="line-599"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189913"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189913"><span class="hs-identifier hs-var">bndr1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-var">cpCloneBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-600"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189912"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189912"><span class="hs-identifier hs-var">bndr2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189911"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189911"><span class="hs-identifier hs-var">rhs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; UniqSM (Id, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeJoinPair"><span class="hs-identifier hs-var">cpeJoinPair</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189913"><span class="hs-identifier hs-var">bndr1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189939"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-601"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Floats, Maybe CoreBind)
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; Id -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnv"><span class="hs-identifier hs-var">extendCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189941"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189940"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189912"><span class="hs-identifier hs-var">bndr2</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-602"></span><span>                 </span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-603"></span><span>                 </span><span class="annot"><span class="annottext">CoreBind -&gt; Maybe CoreBind
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189912"><span class="hs-identifier hs-var">bndr2</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189911"><span class="hs-identifier hs-var">rhs1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeBind"><span class="hs-identifier hs-var">cpeBind</span></a></span><span> </span><span id="local-6989586621681189908"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189908"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span> </span><span id="local-6989586621681189907"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189907"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681189905"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189905"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isJoinId"><span class="hs-identifier hs-var">isJoinId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Id
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-607"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189902"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189902"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189901"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189901"><span class="hs-identifier hs-var">bndrs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var">cpCloneBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189907"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-608"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189899"><span class="annot"><span class="annottext">[(Floats, CpeRhs)]
</span><a href="#local-6989586621681189899"><span class="hs-identifier hs-var">stuff</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs))
-&gt; [Id] -&gt; [CpeRhs] -&gt; UniqSM [(Floats, CpeRhs)]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; RecFlag
-&gt; Demand
-&gt; Bool
-&gt; CorePrepEnv
-&gt; Id
-&gt; CpeRhs
-&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpePair"><span class="hs-identifier hs-var">cpePair</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189908"><span class="hs-identifier hs-var">top_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#topDmd"><span class="hs-identifier hs-var">topDmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189902"><span class="hs-identifier hs-var">env'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-609"></span><span>                           </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189901"><span class="hs-identifier hs-var">bndrs1</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189895"><span class="hs-identifier hs-var">rhss</span></a></span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189894"><span class="annot"><span class="annottext">[Floats]
</span><a href="#local-6989586621681189894"><span class="hs-identifier hs-var">floats_s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189893"><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189893"><span class="hs-identifier hs-var">rhss1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Floats, CpeRhs)] -&gt; ([Floats], [CpeRhs])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Floats, CpeRhs)]
</span><a href="#local-6989586621681189899"><span class="hs-identifier hs-var">stuff</span></a></span><span>
</span><span id="line-612"></span><span>             </span><span id="local-6989586621681189891"><span class="annot"><span class="annottext">all_pairs :: [(Id, CpeRhs)]
</span><a href="#local-6989586621681189891"><span class="hs-identifier hs-var hs-var">all_pairs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatingBind -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)])
-&gt; [(Id, CpeRhs)] -&gt; OrdList FloatingBind -&gt; [(Id, CpeRhs)]
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; OrdList a -&gt; b
</span><a href="GHC.Data.OrdList.html#foldrOL"><span class="hs-identifier hs-var">foldrOL</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)]
</span><a href="#local-6989586621681189889"><span class="hs-identifier hs-var">add_float</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189901"><span class="hs-identifier hs-var">bndrs1</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [CpeRhs] -&gt; [(Id, CpeRhs)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189893"><span class="hs-identifier hs-var">rhss1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-613"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Floats] -&gt; OrdList FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#concatFloats"><span class="hs-identifier hs-var">concatFloats</span></a></span><span> </span><span class="annot"><span class="annottext">[Floats]
</span><a href="#local-6989586621681189894"><span class="hs-identifier hs-var">floats_s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Floats, Maybe CoreBind)
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [(Id, Id)] -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvList"><span class="hs-identifier hs-var">extendCorePrepEnvList</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189907"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [(Id, Id)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189901"><span class="hs-identifier hs-var">bndrs1</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-616"></span><span>                 </span><span class="annot"><span class="annottext">FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#unitFloat"><span class="hs-identifier hs-var">unitFloat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreBind -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189891"><span class="hs-identifier hs-var">all_pairs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-617"></span><span>                 </span><span class="annot"><span class="annottext">Maybe CoreBind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-comment">-- See Note [Join points and floating]</span><span>
</span><span id="line-620"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189884"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189884"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189883"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189883"><span class="hs-identifier hs-var">bndrs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var">cpCloneBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189907"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-621"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189882"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189882"><span class="hs-identifier hs-var">pairs1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; CpeRhs -&gt; UniqSM (Id, CpeRhs))
-&gt; [Id] -&gt; [CpeRhs] -&gt; UniqSM [(Id, CpeRhs)]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; UniqSM (Id, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeJoinPair"><span class="hs-identifier hs-var">cpeJoinPair</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189884"><span class="hs-identifier hs-var">env'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189883"><span class="hs-identifier hs-var">bndrs1</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189895"><span class="hs-identifier hs-var">rhss</span></a></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189881"><span class="annot"><span class="annottext">bndrs2 :: [Id]
</span><a href="#local-6989586621681189881"><span class="hs-identifier hs-var hs-var">bndrs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Id, CpeRhs) -&gt; Id) -&gt; [(Id, CpeRhs)] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, CpeRhs) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189882"><span class="hs-identifier hs-var">pairs1</span></a></span><span>
</span><span id="line-624"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Floats, Maybe CoreBind)
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [(Id, Id)] -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvList"><span class="hs-identifier hs-var">extendCorePrepEnvList</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189884"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [(Id, Id)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189881"><span class="hs-identifier hs-var">bndrs2</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-625"></span><span>                 </span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-626"></span><span>                 </span><span class="annot"><span class="annottext">CoreBind -&gt; Maybe CoreBind
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189882"><span class="hs-identifier hs-var">pairs1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-627"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-628"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681189903"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189903"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189895"><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189895"><span class="hs-identifier hs-var">rhss</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; ([Id], [CpeRhs])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189905"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-629"></span><span>
</span><span id="line-630"></span><span>        </span><span class="hs-comment">-- Flatten all the floats, and the current</span><span>
</span><span id="line-631"></span><span>        </span><span class="hs-comment">-- group into a single giant Rec</span><span>
</span><span id="line-632"></span><span>    </span><span id="local-6989586621681189889"><span class="annot"><span class="annottext">add_float :: FloatingBind -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)]
</span><a href="#local-6989586621681189889"><span class="hs-identifier hs-var hs-var">add_float</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681189877"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189877"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681189876"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189876"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189875"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189875"><span class="hs-identifier hs-var">prs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189877"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189876"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Id, CpeRhs) -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189875"><span class="hs-identifier hs-var">prs2</span></a></span><span>
</span><span id="line-633"></span><span>    </span><span class="annot"><a href="#local-6989586621681189889"><span class="hs-identifier hs-var">add_float</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681189874"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189874"><span class="hs-identifier hs-var">prs1</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span id="local-6989586621681189873"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189873"><span class="hs-identifier hs-var">prs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189874"><span class="hs-identifier hs-var">prs1</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189873"><span class="hs-identifier hs-var">prs2</span></a></span><span>
</span><span id="line-634"></span><span>    </span><span class="annot"><a href="#local-6989586621681189889"><span class="hs-identifier hs-var">add_float</span></a></span><span> </span><span id="local-6989586621681189872"><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189872"><span class="hs-identifier hs-var">b</span></a></span></span><span>                       </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [(Id, CpeRhs)]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cpeBind&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189872"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpePair"><span class="hs-identifier hs-type">cpePair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html#Demand"><span class="hs-identifier hs-type">Demand</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-638"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#OutId"><span class="hs-identifier hs-type">OutId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-639"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-640"></span><span class="hs-comment">-- Used for all bindings</span><span>
</span><span id="line-641"></span><span class="hs-comment">-- The binder is already cloned, hence an OutId</span><span>
</span><span id="line-642"></span><span id="cpePair"><span class="annot"><span class="annottext">cpePair :: TopLevelFlag
-&gt; RecFlag
-&gt; Demand
-&gt; Bool
-&gt; CorePrepEnv
-&gt; Id
-&gt; CpeRhs
-&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpePair"><span class="hs-identifier hs-var hs-var">cpePair</span></a></span></span><span> </span><span id="local-6989586621681189869"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189869"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span> </span><span id="local-6989586621681189868"><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189868"><span class="hs-identifier hs-var">is_rec</span></a></span></span><span> </span><span id="local-6989586621681189867"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189867"><span class="hs-identifier hs-var">dmd</span></a></span></span><span> </span><span id="local-6989586621681189866"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189866"><span class="hs-identifier hs-var">is_unlifted</span></a></span></span><span> </span><span id="local-6989586621681189865"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189865"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189864"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189864"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189863"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189863"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-643"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isJoinId</span><span> </span><span class="hs-identifier">bndr</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- those should use cpeJoinPair</span><span>
</span><span id="line-644"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189862"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189862"><span class="hs-identifier hs-var">floats1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189861"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189861"><span class="hs-identifier hs-var">rhs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189865"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189863"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span>       </span><span class="hs-comment">-- See if we are allowed to float this stuff out of the RHS</span><span>
</span><span id="line-647"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189859"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189859"><span class="hs-identifier hs-var">floats2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189858"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189858"><span class="hs-identifier hs-var">rhs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189857"><span class="hs-identifier hs-var">float_from_rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189862"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189861"><span class="hs-identifier hs-var">rhs1</span></a></span><span>
</span><span id="line-648"></span><span>
</span><span id="line-649"></span><span>       </span><span class="hs-comment">-- Make the arity match up</span><span>
</span><span id="line-650"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189856"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189856"><span class="hs-identifier hs-var">floats3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189855"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189855"><span class="hs-identifier hs-var">rhs3</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-651"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Int
</span><a href="GHC.Core.Opt.Arity.html#manifestArity"><span class="hs-identifier hs-var">manifestArity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189861"><span class="hs-identifier hs-var">rhs1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189852"><span class="hs-identifier hs-var">arity</span></a></span><span>
</span><span id="line-652"></span><span>               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189859"><span class="hs-identifier hs-var">floats2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var">cpeEtaExpand</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189852"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189858"><span class="hs-identifier hs-var">rhs2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-653"></span><span>               </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">WARN</span><span class="hs-special">(</span><span class="hs-identifier">True</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;CorePrep: silly extra arguments:&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">bndr</span><span class="hs-special">)</span><span>
</span><span id="line-654"></span><span>                               </span><span class="hs-comment">-- Note [Silly extra arguments]</span><span>
</span><span id="line-655"></span><span>                    </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189849"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189849"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189864"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-656"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189847"><span class="annot"><span class="annottext">float :: FloatingBind
</span><a href="#local-6989586621681189847"><span class="hs-identifier hs-var hs-var">float</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Demand -&gt; Bool -&gt; Id -&gt; CpeRhs -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#mkFloat"><span class="hs-identifier hs-var">mkFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#topDmd"><span class="hs-identifier hs-var">topDmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189849"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189858"><span class="hs-identifier hs-var">rhs2</span></a></span><span>
</span><span id="line-657"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var">addFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189859"><span class="hs-identifier hs-var">floats2</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189847"><span class="hs-identifier hs-var">float</span></a></span><span>
</span><span id="line-658"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var">cpeEtaExpand</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189852"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189849"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span>
</span><span id="line-660"></span><span>        </span><span class="hs-comment">-- Wrap floating ticks</span><span>
</span><span id="line-661"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189846"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189846"><span class="hs-identifier hs-var">floats4</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189845"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189845"><span class="hs-identifier hs-var">rhs4</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#wrapTicks"><span class="hs-identifier hs-var">wrapTicks</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189856"><span class="hs-identifier hs-var">floats3</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189855"><span class="hs-identifier hs-var">rhs3</span></a></span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189846"><span class="hs-identifier hs-var">floats4</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189845"><span class="hs-identifier hs-var">rhs4</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-664"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-665"></span><span>    </span><span id="local-6989586621681189852"><span class="annot"><span class="annottext">arity :: Int
</span><a href="#local-6989586621681189852"><span class="hs-identifier hs-var hs-var">arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Int
</span><a href="GHC.Types.Id.html#idArity"><span class="hs-identifier hs-var">idArity</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189864"><span class="hs-identifier hs-var">bndr</span></a></span><span>        </span><span class="hs-comment">-- We must match this arity</span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span>    </span><span class="hs-comment">---------------------</span><span>
</span><span id="line-668"></span><span>    </span><span id="local-6989586621681189857"><span class="annot"><span class="annottext">float_from_rhs :: Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189857"><span class="hs-identifier hs-var hs-var">float_from_rhs</span></a></span></span><span> </span><span id="local-6989586621681189841"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189841"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189840"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189840"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-669"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isEmptyFloats"><span class="hs-identifier hs-var">isEmptyFloats</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189841"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189840"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-670"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#isTopLevel"><span class="hs-identifier hs-var">isTopLevel</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681189869"><span class="hs-identifier hs-var">top_lvl</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189838"><span class="hs-identifier hs-var">float_top</span></a></span><span>    </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189841"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189840"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-671"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189837"><span class="hs-identifier hs-var">float_nested</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189841"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189840"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-672"></span><span>
</span><span id="line-673"></span><span>    </span><span class="hs-comment">---------------------</span><span>
</span><span id="line-674"></span><span>    </span><span id="local-6989586621681189837"><span class="annot"><span class="annottext">float_nested :: Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189837"><span class="hs-identifier hs-var hs-var">float_nested</span></a></span></span><span> </span><span id="local-6989586621681189835"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189835"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189834"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189834"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-675"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RecFlag -&gt; Demand -&gt; Bool -&gt; Floats -&gt; CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#wantFloatNested"><span class="hs-identifier hs-var">wantFloatNested</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189868"><span class="hs-identifier hs-var">is_rec</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189867"><span class="hs-identifier hs-var">dmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189866"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189835"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189834"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-676"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189835"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189834"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-677"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#dontFloat"><span class="hs-identifier hs-var">dontFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189835"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189834"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-678"></span><span>
</span><span id="line-679"></span><span>    </span><span class="hs-comment">---------------------</span><span>
</span><span id="line-680"></span><span>    </span><span id="local-6989586621681189838"><span class="annot"><span class="annottext">float_top :: Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189838"><span class="hs-identifier hs-var hs-var">float_top</span></a></span></span><span> </span><span id="local-6989586621681189829"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189829"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189828"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189828"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-681"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#allLazyTop"><span class="hs-identifier hs-var">allLazyTop</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189829"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-682"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189829"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189828"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-683"></span><span>
</span><span id="line-684"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189826"><span class="annot"><span class="annottext">(Floats, CpeRhs)
</span><a href="#local-6989586621681189826"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; Maybe (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#canFloat"><span class="hs-identifier hs-var">canFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189829"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189828"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-685"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs)
</span><a href="#local-6989586621681189826"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-686"></span><span>
</span><span id="line-687"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-688"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#dontFloat"><span class="hs-identifier hs-var">dontFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189829"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189828"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-689"></span><span>
</span><span id="line-690"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#dontFloat"><span class="hs-identifier hs-type">dontFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-691"></span><span class="hs-comment">-- Non-empty floats, but do not want to float from rhs</span><span>
</span><span id="line-692"></span><span class="hs-comment">-- So wrap the rhs in the floats</span><span>
</span><span id="line-693"></span><span class="hs-comment">-- But: rhs1 might have lambdas, and we can't</span><span>
</span><span id="line-694"></span><span class="hs-comment">--      put them inside a wrapBinds</span><span>
</span><span id="line-695"></span><span id="dontFloat"><span class="annot"><span class="annottext">dontFloat :: Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#dontFloat"><span class="hs-identifier hs-var hs-var">dontFloat</span></a></span></span><span> </span><span id="local-6989586621681189824"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189824"><span class="hs-identifier hs-var">floats1</span></a></span></span><span> </span><span id="local-6989586621681189823"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189823"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-696"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189822"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189822"><span class="hs-identifier hs-var">floats2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189821"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189821"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189823"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-697"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#wrapBinds"><span class="hs-identifier hs-var">wrapBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189824"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">(CpeRhs -&gt; CpeRhs) -&gt; CpeRhs -&gt; CpeRhs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-698"></span><span>                               </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#wrapBinds"><span class="hs-identifier hs-var">wrapBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189822"><span class="hs-identifier hs-var">floats2</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189821"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-699"></span><span>
</span><span id="line-700"></span><span class="hs-comment">{- Note [Silly extra arguments]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we had this
        f{arity=1} = \x\y. e
We *must* match the arity on the Id, so we have to generate
        f' = \x\y. e
        f  = \x. f' x

It's a bizarre case: why is the arity on the Id wrong?  Reason
(in the days of __inline_me__):
        f{arity=0} = __inline_me__ (let v = expensive in \xy. e)
When InlineMe notes go away this won't happen any more.  But
it seems good for CorePrep to be robust.
-}</span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-716"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeJoinPair"><span class="hs-identifier hs-type">cpeJoinPair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#JoinId"><span class="hs-identifier hs-type">JoinId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-717"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#JoinId"><span class="hs-identifier hs-type">JoinId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-718"></span><span class="hs-comment">-- Used for all join bindings</span><span>
</span><span id="line-719"></span><span class="hs-comment">-- No eta-expansion: see Note [Do not eta-expand join points] in GHC.Core.Opt.Simplify.Utils</span><span>
</span><span id="line-720"></span><span id="cpeJoinPair"><span class="annot"><span class="annottext">cpeJoinPair :: CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; UniqSM (Id, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeJoinPair"><span class="hs-identifier hs-var hs-var">cpeJoinPair</span></a></span></span><span> </span><span id="local-6989586621681189817"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189817"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189816"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189816"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189815"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189815"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-721"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isJoinId</span><span> </span><span class="hs-identifier">bndr</span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189814"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189814"><span class="hs-identifier hs-var">join_arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe Int
</span><a href="GHC.Types.Id.html#isJoinId_maybe"><span class="hs-identifier hs-var">isJoinId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189816"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-723"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681189812"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189812"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189811"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189811"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; ([Id], CpeRhs)
forall b. Int -&gt; Expr b -&gt; ([b], Expr b)
</span><a href="GHC.Core.html#collectNBinders"><span class="hs-identifier hs-var">collectNBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189814"><span class="hs-identifier hs-var">join_arity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189815"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-724"></span><span>
</span><span id="line-725"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189809"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189809"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189808"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189808"><span class="hs-identifier hs-var">bndrs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var">cpCloneBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189817"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189812"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-726"></span><span>
</span><span id="line-727"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189807"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189807"><span class="hs-identifier hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var">cpeBodyNF</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189809"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189811"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="hs-comment">-- Will let-bind the body if it starts</span><span>
</span><span id="line-728"></span><span>                                      </span><span class="hs-comment">-- with a lambda</span><span>
</span><span id="line-729"></span><span>
</span><span id="line-730"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189806"><span class="annot"><span class="annottext">rhs' :: CpeRhs
</span><a href="#local-6989586621681189806"><span class="hs-identifier hs-var hs-var">rhs'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Make.html#mkCoreLams"><span class="hs-identifier hs-var">mkCoreLams</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189808"><span class="hs-identifier hs-var">bndrs'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189807"><span class="hs-identifier hs-var">body'</span></a></span><span>
</span><span id="line-731"></span><span>             </span><span id="local-6989586621681189804"><span class="annot"><span class="annottext">bndr' :: Id
</span><a href="#local-6989586621681189804"><span class="hs-identifier hs-var hs-var">bndr'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189816"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unfolding -&gt; Id
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span> </span><span class="annot"><span class="annottext">Unfolding
</span><a href="GHC.Core.html#evaldUnfolding"><span class="hs-identifier hs-var">evaldUnfolding</span></a></span><span>
</span><span id="line-732"></span><span>                          </span><span class="annot"><span class="annottext">Id -&gt; Int -&gt; Id
</span><a href="GHC.Types.Id.html#setIdArity"><span class="hs-operator hs-var">`setIdArity`</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; Int
forall a. (a -&gt; Bool) -&gt; [a] -&gt; Int
</span><a href="GHC.Utils.Misc.html#count"><span class="hs-identifier hs-var">count</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189812"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-733"></span><span>                            </span><span class="hs-comment">-- See Note [Arity and join points]</span><span>
</span><span id="line-734"></span><span>
</span><span id="line-735"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Id, CpeRhs) -&gt; UniqSM (Id, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189804"><span class="hs-identifier hs-var">bndr'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189806"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-736"></span><span>
</span><span id="line-737"></span><span class="hs-comment">{-
Note [Arity and join points]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Up to now, we've allowed a join point to have an arity greater than its join
arity (minus type arguments), since this is what's useful for eta expansion.
However, for code gen purposes, its arity must be exactly the number of value
arguments it will be called with, and it must have exactly that many value
lambdas. Hence if there are extra lambdas we must let-bind the body of the RHS:

  join j x y z = \w -&gt; ... in ...
    =&gt;
  join j x y z = (let f = \w -&gt; ... in f) in ...

This is also what happens with Note [Silly extra arguments]. Note that it's okay
for us to mess with the arity because a join point is never exported.
-}</span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-755"></span><span class="hs-comment">--              CpeRhs: produces a result satisfying CpeRhs</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-757"></span><span>
</span><span id="line-758"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-type">cpeRhsE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-759"></span><span class="hs-comment">-- If</span><span>
</span><span id="line-760"></span><span class="hs-comment">--      e  ===&gt;  (bs, e')</span><span>
</span><span id="line-761"></span><span class="hs-comment">-- then</span><span>
</span><span id="line-762"></span><span class="hs-comment">--      e = let bs in e'        (semantically, that is!)</span><span>
</span><span id="line-763"></span><span class="hs-comment">--</span><span>
</span><span id="line-764"></span><span class="hs-comment">-- For example</span><span>
</span><span id="line-765"></span><span class="hs-comment">--      f (g x)   ===&gt;   ([v = g x], f v)</span><span>
</span><span id="line-766"></span><span>
</span><span id="line-767"></span><span id="cpeRhsE"><span class="annot"><span class="annottext">cpeRhsE :: CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var hs-var">cpeRhsE</span></a></span></span><span> </span><span id="local-6989586621681189798"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189798"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189796"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189796"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-768"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CpeRhs
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189798"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189796"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-769"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189794"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189794"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621681189792"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189792"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-770"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; CpeRhs
forall b. Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-var">Coercion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Coercion -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-var">cpSubstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189794"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189792"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-771"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189790"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189790"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189789"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189789"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span id="local-6989586621681189786"><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681189786"><span class="hs-identifier hs-var">nt</span></a></span></span><span> </span><span id="local-6989586621681189785"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189785"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-772"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_convertNumLit"><span class="hs-identifier hs-var hs-var">cpe_convertNumLit</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189790"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681189786"><span class="hs-identifier hs-var">nt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189785"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-773"></span><span>      </span><span class="annot"><span class="annottext">Maybe CpeRhs
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189789"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-774"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189783"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189783"><span class="hs-identifier hs-var">e</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189790"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189783"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-775"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189782"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189782"><span class="hs-identifier hs-var">_env</span></a></span></span><span> </span><span id="local-6989586621681189781"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189781"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189781"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-776"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189780"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189780"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189779"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189779"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeApp"><span class="hs-identifier hs-var">cpeApp</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189780"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189779"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-777"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189777"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189777"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189776"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189776"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-identifier hs-type">App</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeApp"><span class="hs-identifier hs-var">cpeApp</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189777"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189776"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-778"></span><span>
</span><span id="line-779"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189774"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189774"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Let"><span class="hs-identifier hs-type">Let</span></a></span><span> </span><span id="local-6989586621681189772"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189772"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span id="local-6989586621681189771"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189771"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-780"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189770"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189770"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189769"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189769"><span class="hs-identifier hs-var">bind_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189768"><span class="annot"><span class="annottext">Maybe CoreBind
</span><a href="#local-6989586621681189768"><span class="hs-identifier hs-var">maybe_bind'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; CorePrepEnv
-&gt; CoreBind
-&gt; UniqSM (CorePrepEnv, Floats, Maybe CoreBind)
</span><a href="GHC.CoreToStg.Prep.html#cpeBind"><span class="hs-identifier hs-var">cpeBind</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="GHC.Types.Basic.html#NotTopLevel"><span class="hs-identifier hs-var">NotTopLevel</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189774"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189772"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-781"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189766"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189766"><span class="hs-identifier hs-var">body_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189765"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189765"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189770"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189771"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-782"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189764"><span class="annot"><span class="annottext">expr' :: CpeRhs
</span><a href="#local-6989586621681189764"><span class="hs-identifier hs-var hs-var">expr'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CoreBind
</span><a href="#local-6989586621681189768"><span class="hs-identifier hs-var">maybe_bind'</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189763"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189763"><span class="hs-identifier hs-var">bind'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CpeRhs -&gt; CpeRhs
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189763"><span class="hs-identifier hs-var">bind'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189765"><span class="hs-identifier hs-var">body'</span></a></span><span>
</span><span id="line-783"></span><span>                                         </span><span class="annot"><span class="annottext">Maybe CoreBind
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189765"><span class="hs-identifier hs-var">body'</span></a></span><span>
</span><span id="line-784"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189769"><span class="hs-identifier hs-var">bind_floats</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189766"><span class="hs-identifier hs-var">body_floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189764"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189762"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189762"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621681189761"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span></span><span> </span><span id="local-6989586621681189760"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189760"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-787"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishPlacement
forall id. Tickish id -&gt; TickishPlacement
</span><a href="GHC.Core.html#tickishPlace"><span class="hs-identifier hs-var">tickishPlace</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">TickishPlacement -&gt; TickishPlacement -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TickishPlacement
</span><a href="GHC.Core.html#PlaceNonLam"><span class="hs-identifier hs-var">PlaceNonLam</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishScoping -&gt; Bool
forall id. Tickish id -&gt; TickishScoping -&gt; Bool
</span><a href="GHC.Core.html#tickishScopesLike"><span class="hs-operator hs-var">`tickishScopesLike`</span></a></span><span> </span><span class="annot"><span class="annottext">TickishScoping
</span><a href="GHC.Core.html#SoftScope"><span class="hs-identifier hs-var">SoftScope</span></a></span><span>
</span><span id="line-788"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189755"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189755"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189754"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189754"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189762"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189760"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-789"></span><span>         </span><span class="hs-comment">-- See [Floating Ticks in CorePrep]</span><span>
</span><span id="line-790"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#unitFloat"><span class="hs-identifier hs-var">unitFloat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-var">FloatTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189755"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189754"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-791"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-792"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189752"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189752"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var">cpeBodyNF</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189762"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189760"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-793"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189750"><span class="hs-identifier hs-var">tickish'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189752"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-794"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-795"></span><span>    </span><span id="local-6989586621681189750"><span class="annot"><span class="annottext">tickish' :: Tickish Id
</span><a href="#local-6989586621681189750"><span class="hs-identifier hs-var hs-var">tickish'</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#Breakpoint"><span class="hs-identifier hs-type">Breakpoint</span></a></span><span> </span><span id="local-6989586621681189747"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189747"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681189746"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189746"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span><span>
</span><span id="line-796"></span><span>             </span><span class="hs-comment">-- See also 'substTickish'</span><span>
</span><span id="line-797"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Id] -&gt; Tickish Id
forall id. Int -&gt; [id] -&gt; Tickish id
</span><a href="GHC.Core.html#Breakpoint"><span class="hs-identifier hs-var">Breakpoint</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189747"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Id) -&gt; [Id] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; CpeRhs -&gt; Id
CpeRhs -&gt; Id
</span><a href="GHC.Core.Utils.html#getIdFromTrivialExpr"><span class="hs-identifier hs-var">getIdFromTrivialExpr</span></a></span><span> </span><span class="annot"><span class="annottext">(CpeRhs -&gt; Id) -&gt; (Id -&gt; CpeRhs) -&gt; Id -&gt; Id
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#lookupCorePrepEnv"><span class="hs-identifier hs-var">lookupCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189762"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189746"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-798"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-799"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189761"><span class="hs-identifier hs-var">tickish</span></a></span><span>
</span><span id="line-800"></span><span>
</span><span id="line-801"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189742"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189742"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621681189740"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189740"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621681189739"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189739"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-802"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189738"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189738"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189737"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189737"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189742"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189740"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-803"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189738"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Coercion -&gt; CpeRhs
forall b. Expr b -&gt; Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-var">Cast</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189737"><span class="hs-identifier hs-var">expr'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Coercion -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-var">cpSubstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189742"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189739"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-804"></span><span>
</span><span id="line-805"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189736"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189736"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189735"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189735"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-806"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189733"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189733"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681189732"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189732"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; ([Id], CpeRhs)
forall b. Expr b -&gt; ([b], Expr b)
</span><a href="GHC.Core.html#collectBinders"><span class="hs-identifier hs-var">collectBinders</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189735"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-807"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189730"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189730"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189729"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189729"><span class="hs-identifier hs-var">bndrs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var">cpCloneBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189736"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189733"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-808"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189728"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189728"><span class="hs-identifier hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var">cpeBodyNF</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189730"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189732"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-809"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CpeRhs -&gt; CpeRhs
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189729"><span class="hs-identifier hs-var">bndrs'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189728"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span class="hs-comment">-- Eliminate empty case</span><span>
</span><span id="line-812"></span><span class="hs-comment">-- See Note [Unsafe coercions]</span><span>
</span><span id="line-813"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189726"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189726"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621681189724"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189724"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189723"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189723"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-814"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189722"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189722"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189721"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189721"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189726"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189724"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-815"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189720"><span class="annot"><span class="annottext">ty' :: Type
</span><a href="#local-6989586621681189720"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189726"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189723"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-816"></span><span>             </span><span id="local-6989586621681189719"><span class="annot"><span class="annottext">co' :: Coercion
</span><a href="#local-6989586621681189719"><span class="hs-identifier hs-var hs-var">co'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role -&gt; Type -&gt; Type -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#mkUnsafeCo"><span class="hs-identifier hs-var">mkUnsafeCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Representational"><span class="hs-identifier hs-var">Representational</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189721"><span class="hs-identifier hs-var">scrut'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189720"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-817"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189722"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Coercion -&gt; CpeRhs
forall b. Expr b -&gt; Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-var">Cast</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189721"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189719"><span class="hs-identifier hs-var">co'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-818"></span><span>   </span><span class="hs-comment">-- This can give rise to</span><span>
</span><span id="line-819"></span><span>   </span><span class="hs-comment">--   Warning: Unsafe coercion: between unboxed and boxed value</span><span>
</span><span id="line-820"></span><span>   </span><span class="hs-comment">-- but it's fine because 'scrut' diverges</span><span>
</span><span id="line-821"></span><span>
</span><span id="line-822"></span><span class="hs-comment">-- Eliminate unsafeEqualityProof</span><span>
</span><span id="line-823"></span><span class="hs-comment">-- See Note [Unsafe coercions]</span><span>
</span><span id="line-824"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189715"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189715"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621681189714"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189714"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681189713"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189713"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189712"><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189712"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-825"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#isUnsafeEqualityProof"><span class="hs-identifier hs-var">isUnsafeEqualityProof</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189714"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-826"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isDeadBinder"><span class="hs-identifier hs-var">isDeadBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189713"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-comment">-- We can only discard the case if the case-binder</span><span>
</span><span id="line-827"></span><span>                      </span><span class="hs-comment">-- is dead.  It usually is, but see #18227</span><span>
</span><span id="line-828"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681189709"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189709"><span class="hs-identifier hs-var">co_var</span></a></span></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189708"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189708"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189712"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-829"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621681189705"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189705"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681189704"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189704"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Id -&gt; Pair Type
Id -&gt; Pair Type
</span><a href="GHC.Core.Coercion.html#coVarTypes"><span class="hs-identifier hs-var">coVarTypes</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189709"><span class="hs-identifier hs-var">co_var</span></a></span><span>
</span><span id="line-830"></span><span>        </span><span id="local-6989586621681189702"><span class="annot"><span class="annottext">the_co :: Coercion
</span><a href="#local-6989586621681189702"><span class="hs-identifier hs-var hs-var">the_co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Role -&gt; Type -&gt; Type -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#mkUnsafeCo"><span class="hs-identifier hs-var">mkUnsafeCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189715"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189705"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189715"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189704"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-831"></span><span>        </span><span id="local-6989586621681189700"><span class="annot"><span class="annottext">env' :: CorePrepEnv
</span><a href="#local-6989586621681189700"><span class="hs-identifier hs-var hs-var">env'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; Coercion -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCoVarEnv"><span class="hs-identifier hs-var">extendCoVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189715"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189709"><span class="hs-identifier hs-var">co_var</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189702"><span class="hs-identifier hs-var">the_co</span></a></span><span>
</span><span id="line-832"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189700"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189708"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-833"></span><span>
</span><span id="line-834"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span id="local-6989586621681189698"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189698"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621681189697"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189697"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681189696"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189696"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189695"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189695"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681189694"><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189694"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-835"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189693"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189693"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189692"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189692"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeBody"><span class="hs-identifier hs-var">cpeBody</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189698"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189697"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-836"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189690"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189690"><span class="hs-identifier hs-var">env'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189689"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189689"><span class="hs-identifier hs-var">bndr2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-var">cpCloneBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189698"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189696"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-837"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189688"><span class="annot"><span class="annottext">alts' :: [Alt Id]
</span><a href="#local-6989586621681189688"><span class="hs-identifier hs-var hs-var">alts'</span></a></span></span><span>
</span><span id="line-838"></span><span>                 </span><span class="hs-comment">-- This flag is intended to aid in debugging strictness</span><span>
</span><span id="line-839"></span><span>                 </span><span class="hs-comment">-- analysis bugs. These are particularly nasty to chase down as</span><span>
</span><span id="line-840"></span><span>                 </span><span class="hs-comment">-- they may manifest as segmentation faults. When this flag is</span><span>
</span><span id="line-841"></span><span>                 </span><span class="hs-comment">-- enabled we instead produce an 'error' expression to catch</span><span>
</span><span id="line-842"></span><span>                 </span><span class="hs-comment">-- the case where a function we think should bottom</span><span>
</span><span id="line-843"></span><span>                 </span><span class="hs-comment">-- unexpectedly returns.</span><span>
</span><span id="line-844"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_CatchBottoms"><span class="hs-identifier hs-var">Opt_CatchBottoms</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; DynFlags
</span><a href="GHC.CoreToStg.Prep.html#cpe_dynFlags"><span class="hs-identifier hs-var hs-var">cpe_dynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189698"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-845"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Alt Id] -&gt; Bool
forall b. [Alt b] -&gt; Bool
</span><a href="GHC.Core.Utils.html#altsAreExhaustive"><span class="hs-identifier hs-var">altsAreExhaustive</span></a></span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189694"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-846"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Alt Id] -&gt; Maybe CpeRhs -&gt; [Alt Id]
forall a b. [(AltCon, [a], b)] -&gt; Maybe b -&gt; [(AltCon, [a], b)]
</span><a href="GHC.Core.Utils.html#addDefault"><span class="hs-identifier hs-var">addDefault</span></a></span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189694"><span class="hs-identifier hs-var">alts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Maybe CpeRhs
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189682"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-847"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189694"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-848"></span><span>               </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681189682"><span class="annot"><span class="annottext">err :: CpeRhs
</span><a href="#local-6989586621681189682"><span class="hs-identifier hs-var hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type -&gt; String -&gt; CpeRhs
</span><a href="GHC.Core.Make.html#mkRuntimeErrorApp"><span class="hs-identifier hs-var">mkRuntimeErrorApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#rUNTIME_ERROR_ID"><span class="hs-identifier hs-var">rUNTIME_ERROR_ID</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189695"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-849"></span><span>                                             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Bottoming expression returned&quot;</span></span><span>
</span><span id="line-850"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189679"><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189679"><span class="hs-identifier hs-var">alts''</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Alt Id -&gt; UniqSM (Alt Id)) -&gt; [Alt Id] -&gt; UniqSM [Alt Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Alt Id -&gt; UniqSM (Alt Id)
forall {a}.
CorePrepEnv -&gt; (a, [Id], CpeRhs) -&gt; UniqSM (a, [Id], CpeRhs)
</span><a href="#local-6989586621681189677"><span class="hs-identifier hs-var">sat_alt</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189690"><span class="hs-identifier hs-var">env'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189688"><span class="hs-identifier hs-var">alts'</span></a></span><span>
</span><span id="line-851"></span><span>
</span><span id="line-852"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189693"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CpeRhs
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189692"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189689"><span class="hs-identifier hs-var">bndr2</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189695"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189679"><span class="hs-identifier hs-var">alts''</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-853"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-854"></span><span>    </span><span id="local-6989586621681189677"><span class="annot"><span class="annottext">sat_alt :: CorePrepEnv -&gt; (a, [Id], CpeRhs) -&gt; UniqSM (a, [Id], CpeRhs)
</span><a href="#local-6989586621681189677"><span class="hs-identifier hs-var hs-var">sat_alt</span></a></span></span><span> </span><span id="local-6989586621681189673"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189673"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189672"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681189672"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189671"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189671"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189670"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189670"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-855"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189669"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189669"><span class="hs-identifier hs-var">env2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189668"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189668"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var">cpCloneBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189673"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189671"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-856"></span><span>            </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189667"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189667"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var">cpeBodyNF</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189669"><span class="hs-identifier hs-var">env2</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189670"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-857"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, [Id], CpeRhs) -&gt; UniqSM (a, [Id], CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681189672"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189668"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189667"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-858"></span><span>
</span><span id="line-859"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-860"></span><span class="hs-comment">--              CpeBody: produces a result satisfying CpeBody</span><span>
</span><span id="line-861"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span class="hs-comment">-- | Convert a 'CoreExpr' so it satisfies 'CpeBody', without</span><span>
</span><span id="line-864"></span><span class="hs-comment">-- producing any floats (any generated floats are immediately</span><span>
</span><span id="line-865"></span><span class="hs-comment">-- let-bound using 'wrapBinds').  Generally you want this, esp.</span><span>
</span><span id="line-866"></span><span class="hs-comment">-- when you've reached a binding form (e.g., a lambda) and</span><span>
</span><span id="line-867"></span><span class="hs-comment">-- floating any further would be incorrect.</span><span>
</span><span id="line-868"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-type">cpeBodyNF</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span>
</span><span id="line-869"></span><span id="cpeBodyNF"><span class="annot"><span class="annottext">cpeBodyNF :: CorePrepEnv -&gt; CpeRhs -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeBodyNF"><span class="hs-identifier hs-var hs-var">cpeBodyNF</span></a></span></span><span> </span><span id="local-6989586621681189666"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189666"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189665"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189665"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-870"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189664"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189664"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189663"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189663"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeBody"><span class="hs-identifier hs-var">cpeBody</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189666"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189665"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-871"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM CpeRhs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#wrapBinds"><span class="hs-identifier hs-var">wrapBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189664"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189663"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-872"></span><span>
</span><span id="line-873"></span><span class="hs-comment">-- | Convert a 'CoreExpr' so it satisfies 'CpeBody'; also produce</span><span>
</span><span id="line-874"></span><span class="hs-comment">-- a list of 'Floats' which are being propagated upwards.  In</span><span>
</span><span id="line-875"></span><span class="hs-comment">-- fact, this function is used in only two cases: to</span><span>
</span><span id="line-876"></span><span class="hs-comment">-- implement 'cpeBodyNF' (which is what you usually want),</span><span>
</span><span id="line-877"></span><span class="hs-comment">-- and in the case when a let-binding is in a case scrutinee--here,</span><span>
</span><span id="line-878"></span><span class="hs-comment">-- we can always float out:</span><span>
</span><span id="line-879"></span><span class="hs-comment">--</span><span>
</span><span id="line-880"></span><span class="hs-comment">--      case (let x = y in z) of ...</span><span>
</span><span id="line-881"></span><span class="hs-comment">--      ==&gt; let x = y in case z of ...</span><span>
</span><span id="line-882"></span><span class="hs-comment">--</span><span>
</span><span id="line-883"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeBody"><span class="hs-identifier hs-type">cpeBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-884"></span><span id="cpeBody"><span class="annot"><span class="annottext">cpeBody :: CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeBody"><span class="hs-identifier hs-var hs-var">cpeBody</span></a></span></span><span> </span><span id="local-6989586621681189662"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189662"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189661"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189661"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-885"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189660"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189660"><span class="hs-identifier hs-var">floats1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189659"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189659"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189662"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189661"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-886"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189658"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189658"><span class="hs-identifier hs-var">floats2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189657"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189657"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189659"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-887"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189660"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189658"><span class="hs-identifier hs-var">floats2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189657"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-888"></span><span>
</span><span id="line-889"></span><span class="hs-comment">--------</span><span>
</span><span id="line-890"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-type">rhsToBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-891"></span><span class="hs-comment">-- Remove top level lambdas by let-binding</span><span>
</span><span id="line-892"></span><span>
</span><span id="line-893"></span><span id="rhsToBody"><span class="annot"><span class="annottext">rhsToBody :: CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var hs-var">rhsToBody</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621681189656"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189656"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681189655"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189655"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-894"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishScoping
forall id. Tickish id -&gt; TickishScoping
</span><a href="GHC.Core.html#tickishScoped"><span class="hs-identifier hs-var">tickishScoped</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189656"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">TickishScoping -&gt; TickishScoping -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TickishScoping
</span><a href="GHC.Core.html#NoScope"><span class="hs-identifier hs-var">NoScope</span></a></span><span>  </span><span class="hs-comment">-- only float out of non-scoped annotations</span><span>
</span><span id="line-895"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189652"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189652"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189651"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189651"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189655"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-896"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189652"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189656"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189651"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-897"></span><span>
</span><span id="line-898"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621681189650"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189650"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681189649"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189649"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-899"></span><span>        </span><span class="hs-comment">-- You can get things like</span><span>
</span><span id="line-900"></span><span>        </span><span class="hs-comment">--      case e of { p -&gt; coerce t (\s -&gt; ...) }</span><span>
</span><span id="line-901"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189648"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189648"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189647"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189647"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189650"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-902"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189648"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Coercion -&gt; CpeRhs
forall b. Expr b -&gt; Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-var">Cast</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189647"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189649"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-903"></span><span>
</span><span id="line-904"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span id="local-6989586621681189646"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189646"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-905"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189645"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189645"><span class="hs-identifier hs-var">no_lam_result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CpeRhs -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-var">tryEtaReducePrep</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189643"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189642"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-906"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189645"><span class="hs-identifier hs-var">no_lam_result</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-907"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189643"><span class="hs-identifier hs-var">bndrs</span></a></span><span>           </span><span class="hs-comment">-- Type lambdas are ok</span><span>
</span><span id="line-908"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189646"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-909"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                   </span><span class="hs-comment">-- Some value lambdas</span><span>
</span><span id="line-910"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189639"><span class="annot"><span class="annottext">rhs :: CpeRhs
</span><a href="#local-6989586621681189639"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var">cpeEtaExpand</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Int
</span><a href="GHC.Core.Opt.Arity.html#exprArity"><span class="hs-identifier hs-var">exprArity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189646"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189646"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-911"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189637"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189637"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189639"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-912"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189636"><span class="annot"><span class="annottext">float :: FloatingBind
</span><a href="#local-6989586621681189636"><span class="hs-identifier hs-var hs-var">float</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189637"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189639"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-913"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#unitFloat"><span class="hs-identifier hs-var">unitFloat</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189636"><span class="hs-identifier hs-var">float</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189637"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-914"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-915"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681189643"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189643"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681189642"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189642"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; ([Id], CpeRhs)
forall b. Expr b -&gt; ([b], Expr b)
</span><a href="GHC.Core.html#collectBinders"><span class="hs-identifier hs-var">collectBinders</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189646"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-916"></span><span>
</span><span id="line-917"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#rhsToBody"><span class="hs-identifier hs-var">rhsToBody</span></a></span><span> </span><span id="local-6989586621681189635"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189635"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189635"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span>
</span><span id="line-920"></span><span>
</span><span id="line-921"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-922"></span><span class="hs-comment">--              CpeApp: produces a result satisfying CpeApp</span><span>
</span><span id="line-923"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-924"></span><span>
</span><span id="line-925"></span><span class="hs-keyword">data</span><span> </span><span id="ArgInfo"><span class="annot"><a href="GHC.CoreToStg.Prep.html#ArgInfo"><span class="hs-identifier hs-var">ArgInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="CpeApp"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-var">CpeApp</span></a></span></span><span>  </span><span class="annot"><a href="GHC.Core.html#CoreArg"><span class="hs-identifier hs-type">CoreArg</span></a></span><span>
</span><span id="line-926"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span id="CpeCast"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeCast"><span class="hs-identifier hs-var">CpeCast</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-927"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span id="CpeTick"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTick"><span class="hs-identifier hs-var">CpeTick</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tickish"><span class="hs-identifier hs-type">Tickish</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-928"></span><span>
</span><span id="line-929"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681189628"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#ArgInfo"><span class="hs-identifier hs-type">ArgInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-930"></span><span>  </span><span id="local-6989586621681189621"><span class="annot"><span class="annottext">ppr :: ArgInfo -&gt; SDoc
</span><a href="#local-6989586621681189621"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189620"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189620"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;app&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189620"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-931"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeCast"><span class="hs-identifier hs-type">CpeCast</span></a></span><span> </span><span id="local-6989586621681189619"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189619"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cast&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189619"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-932"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTick"><span class="hs-identifier hs-type">CpeTick</span></a></span><span> </span><span id="local-6989586621681189618"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189618"><span class="hs-identifier hs-var">tick</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tick&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189618"><span class="hs-identifier hs-var">tick</span></a></span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeApp"><span class="hs-identifier hs-type">cpeApp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-935"></span><span class="hs-comment">-- May return a CpeRhs because of saturating primops</span><span>
</span><span id="line-936"></span><span id="cpeApp"><span class="annot"><span class="annottext">cpeApp :: CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeApp"><span class="hs-identifier hs-var hs-var">cpeApp</span></a></span></span><span> </span><span id="local-6989586621681189617"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189617"><span class="hs-identifier hs-var">top_env</span></a></span></span><span> </span><span id="local-6989586621681189616"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189616"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-937"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189615"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189615"><span class="hs-identifier hs-var">terminal</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189614"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189614"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189613"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189613"><span class="hs-identifier hs-var">depth</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; (CpeRhs, [ArgInfo], Int)
</span><a href="#local-6989586621681189612"><span class="hs-identifier hs-var">collect_args</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189616"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-938"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189617"><span class="hs-identifier hs-var">top_env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189615"><span class="hs-identifier hs-var">terminal</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189614"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189613"><span class="hs-identifier hs-var">depth</span></a></span><span>
</span><span id="line-939"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-940"></span><span>
</span><span id="line-941"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-942"></span><span>    </span><span class="hs-comment">-- We have a nested data structure of the form</span><span>
</span><span id="line-943"></span><span>    </span><span class="hs-comment">-- e `App` a1 `App` a2 ... `App` an, convert it into</span><span>
</span><span id="line-944"></span><span>    </span><span class="hs-comment">-- (e, [CpeApp a1, CpeApp a2, ..., CpeApp an], depth)</span><span>
</span><span id="line-945"></span><span>    </span><span class="hs-comment">-- We use 'ArgInfo' because we may also need to</span><span>
</span><span id="line-946"></span><span>    </span><span class="hs-comment">-- record casts and ticks.  Depth counts the number</span><span>
</span><span id="line-947"></span><span>    </span><span class="hs-comment">-- of arguments that would consume strictness information</span><span>
</span><span id="line-948"></span><span>    </span><span class="hs-comment">-- (so, no type or coercion arguments.)</span><span>
</span><span id="line-949"></span><span>    </span><span class="annot"><a href="#local-6989586621681189612"><span class="hs-identifier hs-type">collect_args</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#ArgInfo"><span class="hs-identifier hs-type">ArgInfo</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-950"></span><span>    </span><span id="local-6989586621681189612"><span class="annot"><span class="annottext">collect_args :: CpeRhs -&gt; (CpeRhs, [ArgInfo], Int)
</span><a href="#local-6989586621681189612"><span class="hs-identifier hs-var hs-var">collect_args</span></a></span></span><span> </span><span id="local-6989586621681189610"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189610"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; (CpeRhs, [ArgInfo], Int)
forall {c}.
Num c =&gt;
CpeRhs -&gt; [ArgInfo] -&gt; c -&gt; (CpeRhs, [ArgInfo], c)
</span><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189610"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-951"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-952"></span><span>        </span><span id="local-6989586621681189609"><span class="annot"><span class="annottext">go :: CpeRhs -&gt; [ArgInfo] -&gt; c -&gt; (CpeRhs, [ArgInfo], c)
</span><a href="#local-6989586621681189609"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-identifier hs-type">App</span></a></span><span> </span><span id="local-6989586621681189604"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189604"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681189603"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189603"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span>      </span><span id="local-6989586621681189602"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189602"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681189601"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189601"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-953"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [ArgInfo] -&gt; c -&gt; (CpeRhs, [ArgInfo], c)
</span><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189604"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; ArgInfo
</span><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-var">CpeApp</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189603"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">ArgInfo -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189602"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-954"></span><span>                </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
forall b. Expr b -&gt; Bool
</span><a href="GHC.Core.html#isTyCoArg"><span class="hs-identifier hs-var">isTyCoArg</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189603"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189601"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189601"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="annot"><span class="annottext">c -&gt; c -&gt; c
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-955"></span><span>        </span><span class="annot"><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621681189598"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189598"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681189597"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189597"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>      </span><span id="local-6989586621681189596"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189596"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span id="local-6989586621681189595"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189595"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-956"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [ArgInfo] -&gt; c -&gt; (CpeRhs, [ArgInfo], c)
</span><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189598"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; ArgInfo
</span><a href="GHC.CoreToStg.Prep.html#CpeCast"><span class="hs-identifier hs-var">CpeCast</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189597"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">ArgInfo -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189596"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189595"><span class="hs-identifier hs-var">depth</span></a></span><span>
</span><span id="line-957"></span><span>        </span><span class="annot"><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621681189594"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189594"><span class="hs-identifier hs-var">tickish</span></a></span></span><span> </span><span id="local-6989586621681189593"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189593"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189592"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189592"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span id="local-6989586621681189591"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189591"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-958"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishPlacement
forall id. Tickish id -&gt; TickishPlacement
</span><a href="GHC.Core.html#tickishPlace"><span class="hs-identifier hs-var">tickishPlace</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189594"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">TickishPlacement -&gt; TickishPlacement -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TickishPlacement
</span><a href="GHC.Core.html#PlaceNonLam"><span class="hs-identifier hs-var">PlaceNonLam</span></a></span><span>
</span><span id="line-959"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189594"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; TickishScoping -&gt; Bool
forall id. Tickish id -&gt; TickishScoping -&gt; Bool
</span><a href="GHC.Core.html#tickishScopesLike"><span class="hs-operator hs-var">`tickishScopesLike`</span></a></span><span> </span><span class="annot"><span class="annottext">TickishScoping
</span><a href="GHC.Core.html#SoftScope"><span class="hs-identifier hs-var">SoftScope</span></a></span><span>
</span><span id="line-960"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [ArgInfo] -&gt; c -&gt; (CpeRhs, [ArgInfo], c)
</span><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189593"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; ArgInfo
</span><a href="GHC.CoreToStg.Prep.html#CpeTick"><span class="hs-identifier hs-var">CpeTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189594"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">ArgInfo -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189592"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189591"><span class="hs-identifier hs-var">depth</span></a></span><span>
</span><span id="line-961"></span><span>        </span><span class="annot"><a href="#local-6989586621681189609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681189590"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189590"><span class="hs-identifier hs-var">terminal</span></a></span></span><span> </span><span id="local-6989586621681189589"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189589"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span id="local-6989586621681189588"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189588"><span class="hs-identifier hs-var">depth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189590"><span class="hs-identifier hs-var">terminal</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189589"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621681189588"><span class="hs-identifier hs-var">depth</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-962"></span><span>
</span><span id="line-963"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-type">cpe_app</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-964"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-965"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#ArgInfo"><span class="hs-identifier hs-type">ArgInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-966"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-967"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-968"></span><span>    </span><span id="local-6989586621681189611"><span class="annot"><span class="annottext">cpe_app :: CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var hs-var">cpe_app</span></a></span></span><span> </span><span id="local-6989586621681189587"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189587"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189586"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189586"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189585"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189585"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189584"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189584"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189583"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189583"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-969"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189586"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#lazyIdKey"><span class="hs-identifier hs-var">lazyIdKey</span></a></span><span>          </span><span class="hs-comment">-- Replace (lazy a) with a, and</span><span>
</span><span id="line-970"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189586"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#noinlineIdKey"><span class="hs-identifier hs-var">noinlineIdKey</span></a></span><span>      </span><span class="hs-comment">-- Replace (noinline a) with a</span><span>
</span><span id="line-971"></span><span>        </span><span class="hs-comment">-- Consider the code:</span><span>
</span><span id="line-972"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-973"></span><span>        </span><span class="hs-comment">--      lazy (f x) y</span><span>
</span><span id="line-974"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-975"></span><span>        </span><span class="hs-comment">-- We need to make sure that we need to recursively collect arguments on</span><span>
</span><span id="line-976"></span><span>        </span><span class="hs-comment">-- &quot;f x&quot;, otherwise we'll float &quot;f x&quot; out (it's not a variable) and</span><span>
</span><span id="line-977"></span><span>        </span><span class="hs-comment">-- end up with this awful -ddump-prep:</span><span>
</span><span id="line-978"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-979"></span><span>        </span><span class="hs-comment">--      case f x of f_x {</span><span>
</span><span id="line-980"></span><span>        </span><span class="hs-comment">--        __DEFAULT -&gt; f_x y</span><span>
</span><span id="line-981"></span><span>        </span><span class="hs-comment">--      }</span><span>
</span><span id="line-982"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-983"></span><span>        </span><span class="hs-comment">-- rather than the far superior &quot;f x y&quot;.  Test case is par01.</span><span>
</span><span id="line-984"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189578"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189578"><span class="hs-identifier hs-var">terminal</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189577"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189577"><span class="hs-identifier hs-var">args'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189576"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189576"><span class="hs-identifier hs-var">depth'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; (CpeRhs, [ArgInfo], Int)
</span><a href="#local-6989586621681189612"><span class="hs-identifier hs-var">collect_args</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189585"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-985"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189587"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189578"><span class="hs-identifier hs-var">terminal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189577"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo] -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189584"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189583"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189576"><span class="hs-identifier hs-var">depth'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-986"></span><span>
</span><span id="line-987"></span><span>    </span><span class="hs-comment">-- See Note [keepAlive# magic].</span><span>
</span><span id="line-988"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span id="local-6989586621681189575"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189575"><span class="hs-identifier hs-var">env</span></a></span></span><span>
</span><span id="line-989"></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189574"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189574"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-990"></span><span>            </span><span id="local-6989586621681189573"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189573"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-991"></span><span>            </span><span id="local-6989586621681189572"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189572"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-992"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="GHC.Builtin.PrimOps.html#KeepAliveOp"><span class="hs-identifier hs-var">KeepAliveOp</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe PrimOp
</span><a href="GHC.Types.Id.html#isPrimOpId_maybe"><span class="hs-identifier hs-var">isPrimOpId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189574"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-993"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189569"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189569"><span class="hs-identifier hs-var">arg_rep</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-994"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189568"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189568"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-995"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189567"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189567"><span class="hs-identifier hs-var">_result_rep</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-996"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189566"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189566"><span class="hs-identifier hs-var">result_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-997"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189565"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189565"><span class="hs-identifier hs-var">arg</span></a></span></span><span>
</span><span id="line-998"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189564"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189564"><span class="hs-identifier hs-var">s0</span></a></span></span><span>
</span><span id="line-999"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189563"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189563"><span class="hs-identifier hs-var">k</span></a></span></span><span>
</span><span id="line-1000"></span><span>          </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189562"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189562"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189573"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-1001"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189561"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189561"><span class="hs-identifier hs-var">y</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189575"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189566"><span class="hs-identifier hs-var">result_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1002"></span><span>             </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681189560"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189560"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#realWorldStatePrimTy"><span class="hs-identifier hs-var">realWorldStatePrimTy</span></a></span><span>
</span><span id="line-1003"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-comment">-- beta reduce if possible</span><span>
</span><span id="line-1004"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189559"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189559"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189558"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189558"><span class="hs-identifier hs-var">k'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189563"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1005"></span><span>                  </span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span id="local-6989586621681189557"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189557"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621681189556"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189556"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvExpr"><span class="hs-identifier hs-var">extendCorePrepEnvExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189575"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189557"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189564"><span class="hs-identifier hs-var">s0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189556"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189562"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189572"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-1006"></span><span>                  </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189575"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189563"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; ArgInfo
</span><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-var">CpeApp</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189564"><span class="hs-identifier hs-var">s0</span></a></span><span> </span><span class="annot"><span class="annottext">ArgInfo -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189562"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189572"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-1007"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189555"><span class="annot"><span class="annottext">touchId :: Id
</span><a href="#local-6989586621681189555"><span class="hs-identifier hs-var hs-var">touchId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimOp -&gt; Id
</span><a href="GHC.Types.Id.Make.html#mkPrimOpId"><span class="hs-identifier hs-var">mkPrimOpId</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="GHC.Builtin.PrimOps.html#TouchOp"><span class="hs-identifier hs-var">TouchOp</span></a></span><span>
</span><span id="line-1008"></span><span>                   </span><span id="local-6989586621681189553"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189553"><span class="hs-identifier hs-var hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CpeRhs
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189558"><span class="hs-identifier hs-var">k'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189561"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189566"><span class="hs-identifier hs-var">result_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189551"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1009"></span><span>                   </span><span id="local-6989586621681189551"><span class="annot"><span class="annottext">rhs :: CpeRhs
</span><a href="#local-6989586621681189551"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189550"><span class="annot"><span class="annottext">scrut :: CpeRhs
</span><a href="#local-6989586621681189550"><span class="hs-identifier hs-var hs-var">scrut</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [CpeRhs] -&gt; CpeRhs
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189555"><span class="hs-identifier hs-var">touchId</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CpeRhs
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189569"><span class="hs-identifier hs-var">arg_rep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CpeRhs
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189568"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189565"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Types.Id.Make.html#realWorldPrimId"><span class="hs-identifier hs-var">realWorldPrimId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1010"></span><span>                         </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CpeRhs
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189550"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189560"><span class="hs-identifier hs-var">s2</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189566"><span class="hs-identifier hs-var">result_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189561"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1011"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189548"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189548"><span class="hs-identifier hs-var">floats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189547"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189547"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeBody"><span class="hs-identifier hs-var">cpeBody</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189575"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189553"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1012"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189559"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189548"><span class="hs-identifier hs-var">floats'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189547"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1013"></span><span>             </span><span class="hs-special">}</span><span>
</span><span id="line-1014"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">PrimOp
</span><a href="GHC.Builtin.PrimOps.html#KeepAliveOp"><span class="hs-identifier hs-var">KeepAliveOp</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe PrimOp
</span><a href="GHC.Types.Id.html#isPrimOpId_maybe"><span class="hs-identifier hs-var">isPrimOpId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189574"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-1015"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; UniqSM (Floats, CpeRhs)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;invalid keepAlive# application&quot;</span></span><span>
</span><span id="line-1016"></span><span>
</span><span id="line-1017"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span id="local-6989586621681189545"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189545"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189544"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189544"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189543"><span class="annot"><span class="annottext">_runtimeRep :: CpeRhs
</span><a href="#local-6989586621681189543"><span class="hs-identifier hs-var">_runtimeRep</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189542"><span class="annot"><span class="annottext">_type :: CpeRhs
</span><a href="#local-6989586621681189542"><span class="hs-identifier hs-var">_type</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189541"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189541"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189540"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189540"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189539"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189539"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-1018"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189544"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#runRWKey"><span class="hs-identifier hs-var">runRWKey</span></a></span><span>
</span><span id="line-1019"></span><span>        </span><span class="hs-comment">-- N.B. While it may appear that n == 1 in the case of runRW#</span><span>
</span><span id="line-1020"></span><span>        </span><span class="hs-comment">-- applications, keep in mind that we may have applications that return</span><span>
</span><span id="line-1021"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189539"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-1022"></span><span>        </span><span class="hs-comment">-- See Note [runRW magic]</span><span>
</span><span id="line-1023"></span><span>        </span><span class="hs-comment">-- Replace (runRW# f) by (f realWorld#), beta reducing if possible (this</span><span>
</span><span id="line-1024"></span><span>        </span><span class="hs-comment">-- is why we return a CorePrepEnv as well)</span><span>
</span><span id="line-1025"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189541"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1026"></span><span>            </span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span id="local-6989586621681189537"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189537"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621681189536"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189536"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; Id -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnv"><span class="hs-identifier hs-var">extendCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189545"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189537"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Types.Id.Make.html#realWorldPrimId"><span class="hs-identifier hs-var">realWorldPrimId</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189536"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189540"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189539"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-1027"></span><span>            </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; CpeRhs -&gt; [ArgInfo] -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
</span><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189545"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189541"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; ArgInfo
</span><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-var">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Types.Id.Make.html#realWorldPrimId"><span class="hs-identifier hs-var">realWorldPrimId</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ArgInfo -&gt; [ArgInfo] -&gt; [ArgInfo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189540"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189539"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-1028"></span><span>             </span><span class="hs-comment">-- TODO: What about casts?</span><span>
</span><span id="line-1029"></span><span>
</span><span id="line-1030"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span id="local-6989586621681189535"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189535"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189534"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189534"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189533"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189533"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681189532"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189532"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-1031"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189531"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189531"><span class="hs-identifier hs-var">v1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#fiddleCCall"><span class="hs-identifier hs-var">fiddleCCall</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189534"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-1032"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189529"><span class="annot"><span class="annottext">e2 :: CpeRhs
</span><a href="#local-6989586621681189529"><span class="hs-identifier hs-var hs-var">e2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#lookupCorePrepEnv"><span class="hs-identifier hs-var">lookupCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189535"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189531"><span class="hs-identifier hs-var">v1</span></a></span><span>
</span><span id="line-1033"></span><span>                 </span><span id="local-6989586621681189528"><span class="annot"><span class="annottext">hd :: Maybe Id
</span><a href="#local-6989586621681189528"><span class="hs-identifier hs-var hs-var">hd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Maybe Id
</span><a href="GHC.Core.Utils.html#getIdFromTrivialExpr_maybe"><span class="hs-identifier hs-var">getIdFromTrivialExpr_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189529"><span class="hs-identifier hs-var">e2</span></a></span><span>
</span><span id="line-1034"></span><span>           </span><span class="hs-comment">-- NB: depth from collect_args is right, because e2 is a trivial expression</span><span>
</span><span id="line-1035"></span><span>           </span><span class="hs-comment">-- and thus its embedded Id *must* be at the same depth as any</span><span>
</span><span id="line-1036"></span><span>           </span><span class="hs-comment">-- Apps it is under are type applications only (c.f.</span><span>
</span><span id="line-1037"></span><span>           </span><span class="hs-comment">-- exprIsTrivial).  But note that we need the type of the</span><span>
</span><span id="line-1038"></span><span>           </span><span class="hs-comment">-- expression, not the id.</span><span>
</span><span id="line-1039"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189526"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189526"><span class="hs-identifier hs-var">app</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189525"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189525"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189535"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189533"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189529"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189523"><span class="hs-identifier hs-var">stricts</span></a></span><span>
</span><span id="line-1040"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; CpeRhs -&gt; Floats -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
forall {a}. Maybe Id -&gt; CpeRhs -&gt; a -&gt; Int -&gt; UniqSM (a, CpeRhs)
</span><a href="#local-6989586621681189522"><span class="hs-identifier hs-var">mb_saturate</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681189528"><span class="hs-identifier hs-var">hd</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189526"><span class="hs-identifier hs-var">app</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189525"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189532"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1041"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-1042"></span><span>          </span><span id="local-6989586621681189523"><span class="annot"><span class="annottext">stricts :: [Demand]
</span><a href="#local-6989586621681189523"><span class="hs-identifier hs-var hs-var">stricts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Id -&gt; StrictSig
</span><a href="GHC.Types.Id.html#idStrictness"><span class="hs-identifier hs-var">idStrictness</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189534"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1043"></span><span>                            </span><span class="annot"><a href="GHC.Types.Demand.html#StrictSig"><span class="hs-identifier hs-type">StrictSig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Demand.html#DmdType"><span class="hs-identifier hs-type">DmdType</span></a></span><span> </span><span class="annot"><span class="annottext">DmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189516"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189516"><span class="hs-identifier hs-var">demands</span></a></span></span><span> </span><span class="annot"><span class="annottext">Divergence
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-1044"></span><span>                              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[Demand] -&gt; Int -&gt; Ordering
forall a. [a] -&gt; Int -&gt; Ordering
</span><a href="GHC.Utils.Misc.html#listLengthCmp"><span class="hs-identifier hs-var">listLengthCmp</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189516"><span class="hs-identifier hs-var">demands</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189532"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="annot"><span class="annottext">Ordering -&gt; Ordering -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189516"><span class="hs-identifier hs-var">demands</span></a></span><span>
</span><span id="line-1045"></span><span>                                    </span><span class="hs-comment">-- length demands &lt;= depth</span><span>
</span><span id="line-1046"></span><span>                              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1047"></span><span>                </span><span class="hs-comment">-- If depth &lt; length demands, then we have too few args to</span><span>
</span><span id="line-1048"></span><span>                </span><span class="hs-comment">-- satisfy strictness  info so we have to  ignore all the</span><span>
</span><span id="line-1049"></span><span>                </span><span class="hs-comment">-- strictness info, e.g. + (error &quot;urk&quot;)</span><span>
</span><span id="line-1050"></span><span>                </span><span class="hs-comment">-- Here, we can't evaluate the arg strictly, because this</span><span>
</span><span id="line-1051"></span><span>                </span><span class="hs-comment">-- partial application might be seq'd</span><span>
</span><span id="line-1052"></span><span>
</span><span id="line-1053"></span><span>        </span><span class="hs-comment">-- We inlined into something that's not a var and has no args.</span><span>
</span><span id="line-1054"></span><span>        </span><span class="hs-comment">-- Bounce it back up to cpeRhsE.</span><span>
</span><span id="line-1055"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span id="local-6989586621681189513"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189513"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189512"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189512"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189513"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189512"><span class="hs-identifier hs-var">fun</span></a></span><span>
</span><span id="line-1056"></span><span>
</span><span id="line-1057"></span><span>        </span><span class="hs-comment">-- N-variable fun, better let-bind it</span><span>
</span><span id="line-1058"></span><span>    </span><span class="annot"><a href="#local-6989586621681189611"><span class="hs-identifier hs-var">cpe_app</span></a></span><span> </span><span id="local-6989586621681189511"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189511"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189510"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189510"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681189509"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189509"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681189508"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189508"><span class="hs-identifier hs-var">depth</span></a></span></span><span>
</span><span id="line-1059"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189507"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189507"><span class="hs-identifier hs-var">fun_floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189506"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189506"><span class="hs-identifier hs-var">fun'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Demand -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeArg"><span class="hs-identifier hs-var">cpeArg</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189511"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#evalDmd"><span class="hs-identifier hs-var">evalDmd</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189510"><span class="hs-identifier hs-var">fun</span></a></span><span>
</span><span id="line-1060"></span><span>                          </span><span class="hs-comment">-- The evalDmd says that it's sure to be evaluated,</span><span>
</span><span id="line-1061"></span><span>                          </span><span class="hs-comment">-- so we'll end up case-binding it</span><span>
</span><span id="line-1062"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189503"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189503"><span class="hs-identifier hs-var">app</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189502"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189502"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189511"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189509"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189506"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189507"><span class="hs-identifier hs-var">fun_floats</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1063"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; CpeRhs -&gt; Floats -&gt; Int -&gt; UniqSM (Floats, CpeRhs)
forall {a}. Maybe Id -&gt; CpeRhs -&gt; a -&gt; Int -&gt; UniqSM (a, CpeRhs)
</span><a href="#local-6989586621681189522"><span class="hs-identifier hs-var">mb_saturate</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189503"><span class="hs-identifier hs-var">app</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189502"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189508"><span class="hs-identifier hs-var">depth</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1064"></span><span>
</span><span id="line-1065"></span><span>    </span><span class="hs-comment">-- Saturate if necessary</span><span>
</span><span id="line-1066"></span><span>    </span><span id="local-6989586621681189522"><span class="annot"><span class="annottext">mb_saturate :: Maybe Id -&gt; CpeRhs -&gt; a -&gt; Int -&gt; UniqSM (a, CpeRhs)
</span><a href="#local-6989586621681189522"><span class="hs-identifier hs-var hs-var">mb_saturate</span></a></span></span><span> </span><span id="local-6989586621681189498"><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681189498"><span class="hs-identifier hs-var">head</span></a></span></span><span> </span><span id="local-6989586621681189497"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189497"><span class="hs-identifier hs-var">app</span></a></span></span><span> </span><span id="local-6989586621681189496"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681189496"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189495"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189495"><span class="hs-identifier hs-var">depth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1067"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681189498"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1068"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189494"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189494"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189493"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189493"><span class="hs-identifier hs-var">sat_app</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; Int -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#maybeSaturate"><span class="hs-identifier hs-var">maybeSaturate</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189494"><span class="hs-identifier hs-var">fn_id</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189497"><span class="hs-identifier hs-var">app</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189495"><span class="hs-identifier hs-var">depth</span></a></span><span>
</span><span id="line-1069"></span><span>                          </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, CpeRhs) -&gt; UniqSM (a, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681189496"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189493"><span class="hs-identifier hs-var">sat_app</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1070"></span><span>         </span><span id="local-6989586621681189491"><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681189491"><span class="hs-identifier hs-var">_other</span></a></span></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(a, CpeRhs) -&gt; UniqSM (a, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681189496"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189497"><span class="hs-identifier hs-var">app</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1071"></span><span>
</span><span id="line-1072"></span><span>    </span><span class="hs-comment">-- Deconstruct and rebuild the application, floating any non-atomic</span><span>
</span><span id="line-1073"></span><span>    </span><span class="hs-comment">-- arguments to the outside.  We collect the type of the expression,</span><span>
</span><span id="line-1074"></span><span>    </span><span class="hs-comment">-- the head of the application, and the number of actual value arguments,</span><span>
</span><span id="line-1075"></span><span>    </span><span class="hs-comment">-- all of which are used to possibly saturate this application if it</span><span>
</span><span id="line-1076"></span><span>    </span><span class="hs-comment">-- has a constructor or primop at the head.</span><span>
</span><span id="line-1077"></span><span>    </span><span class="annot"><a href="#local-6989586621681189524"><span class="hs-identifier hs-type">rebuild_app</span></a></span><span>
</span><span id="line-1078"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1079"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#ArgInfo"><span class="hs-identifier hs-type">ArgInfo</span></a></span><span class="hs-special">]</span><span>                  </span><span class="hs-comment">-- The arguments (inner to outer)</span><span>
</span><span id="line-1080"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span>
</span><span id="line-1081"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-1082"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Demand.html#Demand"><span class="hs-identifier hs-type">Demand</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1083"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1084"></span><span>    </span><span id="local-6989586621681189524"><span class="annot"><span class="annottext">rebuild_app :: CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var hs-var">rebuild_app</span></a></span></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681189490"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189490"><span class="hs-identifier hs-var">app</span></a></span></span><span> </span><span id="local-6989586621681189489"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189489"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189488"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189488"><span class="hs-identifier hs-var">ss</span></a></span></span><span>
</span><span id="line-1085"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">ss</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- make sure we used all the strictness info</span><span>
</span><span id="line-1086"></span><span>        </span><span class="annot"><span class="annottext">(CpeRhs, Floats) -&gt; UniqSM (CpeRhs, Floats)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189490"><span class="hs-identifier hs-var">app</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189489"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1087"></span><span>
</span><span id="line-1088"></span><span>    </span><span class="annot"><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span id="local-6989586621681189486"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189485"><span class="annot"><span class="annottext">ArgInfo
</span><a href="#local-6989586621681189485"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189484"><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189483"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span></span><span> </span><span id="local-6989586621681189482"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189481"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ArgInfo
</span><a href="#local-6989586621681189485"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1089"></span><span>
</span><span id="line-1090"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621681189480"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189480"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1091"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; CpeRhs -&gt; CpeRhs
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CpeRhs
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189479"><span class="hs-identifier hs-var">arg_ty'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1092"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-1093"></span><span>          </span><span id="local-6989586621681189479"><span class="annot"><span class="annottext">arg_ty' :: Type
</span><a href="#local-6989586621681189479"><span class="hs-identifier hs-var hs-var">arg_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189480"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-1094"></span><span>
</span><span id="line-1095"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span id="local-6989586621681189478"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189478"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1096"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; CpeRhs -&gt; CpeRhs
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; CpeRhs
forall b. Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-var">Coercion</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189477"><span class="hs-identifier hs-var">co'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1097"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-1098"></span><span>            </span><span id="local-6989586621681189477"><span class="annot"><span class="annottext">co' :: Coercion
</span><a href="#local-6989586621681189477"><span class="hs-identifier hs-var hs-var">co'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Coercion -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-var">cpSubstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189478"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-1099"></span><span>
</span><span id="line-1100"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span id="local-6989586621681189476"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189476"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1101"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189475"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189475"><span class="hs-identifier hs-var">ss1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189474"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189474"><span class="hs-identifier hs-var">ss_rest</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- See Note [lazyId magic] in GHC.Types.Id.Make</span><span>
</span><span id="line-1102"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189476"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1103"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Demand
</span><span class="hs-identifier">_</span></span><span>   </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189472"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189472"><span class="hs-identifier hs-var">ss_rest</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#topDmd"><span class="hs-identifier hs-var">topDmd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189472"><span class="hs-identifier hs-var">ss_rest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1104"></span><span>                   </span><span class="hs-special">(</span><span id="local-6989586621681189471"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189471"><span class="hs-identifier hs-var">ss1</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189470"><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189470"><span class="hs-identifier hs-var">ss_rest</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189471"><span class="hs-identifier hs-var">ss1</span></a></span><span class="hs-special">,</span><span>    </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189470"><span class="hs-identifier hs-var">ss_rest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1105"></span><span>                   </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>            </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Demand
</span><a href="GHC.Types.Demand.html#topDmd"><span class="hs-identifier hs-var">topDmd</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1106"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681189469"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189469"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189468"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189468"><span class="hs-identifier hs-var">arg'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Demand -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeArg"><span class="hs-identifier hs-var">cpeArg</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189617"><span class="hs-identifier hs-var">top_env</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189475"><span class="hs-identifier hs-var">ss1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189476"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-1107"></span><span>        </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; CpeRhs -&gt; CpeRhs
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189468"><span class="hs-identifier hs-var">arg'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189469"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-operator hs-var">`appendFloats`</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189474"><span class="hs-identifier hs-var">ss_rest</span></a></span><span>
</span><span id="line-1108"></span><span>
</span><span id="line-1109"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeCast"><span class="hs-identifier hs-type">CpeCast</span></a></span><span> </span><span id="local-6989586621681189467"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189467"><span class="hs-identifier hs-var">co</span></a></span></span><span>
</span><span id="line-1110"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Coercion -&gt; CpeRhs
forall b. Expr b -&gt; Coercion -&gt; Expr b
</span><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-var">Cast</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189466"><span class="hs-identifier hs-var">co'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1111"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-1112"></span><span>           </span><span id="local-6989586621681189466"><span class="annot"><span class="annottext">co' :: Coercion
</span><a href="#local-6989586621681189466"><span class="hs-identifier hs-var hs-var">co'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Coercion -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-var">cpSubstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189467"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-1113"></span><span>
</span><span id="line-1114"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTick"><span class="hs-identifier hs-type">CpeTick</span></a></span><span> </span><span id="local-6989586621681189465"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189465"><span class="hs-identifier hs-var">tickish</span></a></span></span><span>
</span><span id="line-1115"></span><span>        </span><span class="hs-comment">-- See [Floating Ticks in CorePrep]</span><span>
</span><span id="line-1116"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
-&gt; [ArgInfo]
-&gt; CpeRhs
-&gt; Floats
-&gt; [Demand]
-&gt; UniqSM (CpeRhs, Floats)
</span><a href="#local-6989586621681189524"><span class="hs-identifier hs-var">rebuild_app</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189486"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[ArgInfo]
</span><a href="#local-6989586621681189484"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189483"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var">addFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189482"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-var">FloatTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189465"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Demand]
</span><a href="#local-6989586621681189481"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-1117"></span><span>
</span><span id="line-1118"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-type">isLazyExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1119"></span><span class="hs-comment">-- See Note [lazyId magic] in GHC.Types.Id.Make</span><span>
</span><span id="line-1120"></span><span id="isLazyExpr"><span class="annot"><span class="annottext">isLazyExpr :: CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var hs-var">isLazyExpr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621681189464"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189464"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189464"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1121"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189463"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189463"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189463"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1122"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189462"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189462"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-operator hs-type">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-operator hs-type">`App`</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189462"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; Unique -&gt; Bool
</span><a href="GHC.Types.Unique.html#hasKey"><span class="hs-operator hs-var">`hasKey`</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="GHC.Builtin.Names.html#lazyIdKey"><span class="hs-identifier hs-var">lazyIdKey</span></a></span><span>
</span><span id="line-1123"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#isLazyExpr"><span class="hs-identifier hs-var">isLazyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1124"></span><span>
</span><span id="line-1125"></span><span class="hs-comment">{- Note [runRW magic]
~~~~~~~~~~~~~~~~~~~~~
Some definitions, for instance @runST@, must have careful control over float out
of the bindings in their body. Consider this use of @runST@,

    f x = runST ( \ s -&gt; let (a, s')  = newArray# 100 [] s
                             (_, s'') = fill_in_array_or_something a x s'
                         in freezeArray# a s'' )

If we inline @runST@, we'll get:

    f x = let (a, s')  = newArray# 100 [] realWorld#{-NB-}
              (_, s'') = fill_in_array_or_something a x s'
          in freezeArray# a s''

And now if we allow the @newArray#@ binding to float out to become a CAF,
we end up with a result that is totally and utterly wrong:

    f = let (a, s')  = newArray# 100 [] realWorld#{-NB-} -- YIKES!!!
        in \ x -&gt;
            let (_, s'') = fill_in_array_or_something a x s'
            in freezeArray# a s''

All calls to @f@ will share a {\em single} array! Clearly this is nonsense and
must be prevented.

This is what @runRW#@ gives us: by being inlined extremely late in the
optimization (right before lowering to STG, in CorePrep), we can ensure that
no further floating will occur. This allows us to safely inline things like
@runST@, which are otherwise needlessly expensive (see #10678 and #5916).

'runRW' has a variety of quirks:

 * 'runRW' is known-key with a NOINLINE definition in
   GHC.Magic. This definition is used in cases where runRW is curried.

 * In addition to its normal Haskell definition in GHC.Magic, we give it
   a special late inlining here in CorePrep and GHC.CoreToByteCode, avoiding
   the incorrect sharing due to float-out noted above.

 * It is levity-polymorphic:

    runRW# :: forall (r1 :: RuntimeRep). (o :: TYPE r)
           =&gt; (State# RealWorld -&gt; (# State# RealWorld, o #))
           -&gt; (# State# RealWorld, o #)

 * It has some special simplification logic to allow unboxing of results when
   runRW# appears in a strict context. See Note [Simplification of runRW#]
   below.

 * Since its body is inlined, we allow runRW#'s argument to contain jumps to
   join points. That is, the following is allowed:

    join j x = ...
    in runRW# @_ @_ (\s -&gt; ... jump j 42 ...)

   The Core Linter knows about this. See Note [Linting of runRW#] in
   GHC.Core.Lint for details.

   The occurrence analyser and SetLevels also know about this, as described in
   Note [Simplification of runRW#].

Other relevant Notes:

 * Note [Simplification of runRW#] below, describing a transformation of runRW
   applications in strict contexts performed by the simplifier.
 * Note [Linting of runRW#] in GHC.Core.Lint
 * Note [runRW arg] below, describing a non-obvious case where the
   late-inlining could go wrong.


 Note [runRW arg]
~~~~~~~~~~~~~~~~~~~
Consider the Core program (from #11291),

   runRW# (case bot of {})

The late inlining logic in cpe_app would transform this into:

   (case bot of {}) realWorldPrimId#

Which would rise to a panic in CoreToStg.myCollectArgs, which expects only
variables in function position.

However, as runRW#'s strictness signature captures the fact that it will call
its argument this can't happen: the simplifier will transform the bottoming
application into simply (case bot of {}).

Note that this reasoning does *not* apply to non-bottoming continuations like:

    hello :: Bool -&gt; Int
    hello n =
      runRW# (
          case n of
            True -&gt; \s -&gt; 23
            _    -&gt; \s -&gt; 10)

Why? The difference is that (case bot of {}) is considered by okCpeArg to be
trivial, consequently cpeArg (which the catch-all case of cpe_app calls on both
the function and the arguments) will forgo binding it to a variable. By
contrast, in the non-bottoming case of `hello` above  the function will be
deemed non-trivial and consequently will be case-bound.


Note [Simplification of runRW#]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider the program,

    case runRW# (\s -&gt; I# 42#) of
      I# n# -&gt; f n#

There is no reason why we should allocate an I# constructor given that we
immediately destructure it.

To avoid this the simplifier has a special transformation rule, specific to
runRW#, that pushes a strict context into runRW#'s continuation.  See the
`runRW#` guard in `GHC.Core.Opt.Simplify.rebuildCall`.  That is, it transforms

    K[ runRW# @r @ty cont ]
              ~&gt;
    runRW# @r @ty (\s -&gt; K[cont s])

This has a few interesting implications. Consider, for instance, this program:

    join j = ...
    in case runRW# @r @ty cont of
         result -&gt; jump j result

Performing the transform described above would result in:

    join j x = ...
    in runRW# @r @ty (\s -&gt;
         case cont of in
           result -&gt; jump j result
       )

If runRW# were a &quot;normal&quot; function this call to join point j would not be
allowed in its continuation argument. However, since runRW# is inlined (as
described in Note [runRW magic] above), such join point occurences are
completely fine. Both occurrence analysis (see the runRW guard in occAnalApp)
and Core Lint (see the App case of lintCoreExpr) have special treatment for
runRW# applications. See Note [Linting of runRW#] for details on the latter.

Moreover, it's helpful to ensure that runRW's continuation isn't floated out
For instance, if we have

    runRW# (\s -&gt; do_something)

where do_something contains only top-level free variables, we may be tempted to
float the argument to the top-level. However, we must resist this urge as since
doing so would then require that runRW# produce an allocation and call, e.g.:

    let lvl = \s -&gt; do_somethign
    in
    ....(runRW# lvl)....

whereas without floating the inlining of the definition of runRW would result
in straight-line code. Consequently, GHC.Core.Opt.SetLevels.lvlApp has special
treatment for runRW# applications, ensure the arguments are not floated as
MFEs.

Now that we float evaluation context into runRW#, we also have to give runRW# a
special higher-order CPR transformer lest we risk #19822. E.g.,

  case runRW# (\s -&gt; doThings) of x -&gt; Data.Text.Text x something something'
      ~&gt;
  runRW# (\s -&gt; case doThings s of x -&gt; Data.Text.Text x something something')

The former had the CPR property, and so should the latter.

Other considered designs
------------------------

One design that was rejected was to *require* that runRW#'s continuation be
headed by a lambda. However, this proved to be quite fragile. For instance,
SetLevels is very eager to float bottoming expressions. For instance given
something of the form,

    runRW# @r @ty (\s -&gt; case expr of x -&gt; undefined)

SetLevels will see that the body the lambda is bottoming and will consequently
float it to the top-level (assuming expr has no free coercion variables which
prevent this). We therefore end up with

    runRW# @r @ty (\s -&gt; lvl s)

Which the simplifier will beta reduce, leaving us with

    runRW# @r @ty lvl

Breaking our desired invariant. Ultimately we decided to simply accept that
the continuation may not be a manifest lambda.


-- ---------------------------------------------------------------------------
--      CpeArg: produces a result satisfying CpeArg
-- ---------------------------------------------------------------------------

Note [ANF-ising literal string arguments]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Consider a program like,

    data Foo = Foo Addr#

    foo = Foo &quot;turtle&quot;#

When we go to ANFise this we might think that we want to float the string
literal like we do any other non-trivial argument. This would look like,

    foo = u\ [] case &quot;turtle&quot;# of s { __DEFAULT__ -&gt; Foo s }

However, this 1) isn't necessary since strings are in a sense &quot;trivial&quot;; and 2)
wreaks havoc on the CAF annotations that we produce here since we the result
above is caffy since it is updateable. Ideally at some point in the future we
would like to just float the literal to the top level as suggested in #11312,

    s = &quot;turtle&quot;#
    foo = Foo s

However, until then we simply add a special case excluding literals from the
floating done by cpeArg.
-}</span><span>
</span><span id="line-1348"></span><span>
</span><span id="line-1349"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkUnsafeCo"><span class="hs-identifier hs-type">mkUnsafeCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.Axiom.html#Role"><span class="hs-identifier hs-type">Role</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-1350"></span><span id="mkUnsafeCo"><span class="annot"><span class="annottext">mkUnsafeCo :: Role -&gt; Type -&gt; Type -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#mkUnsafeCo"><span class="hs-identifier hs-var hs-var">mkUnsafeCo</span></a></span></span><span> </span><span id="local-6989586621681189461"><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621681189461"><span class="hs-keyword hs-var">role</span></a></span></span><span> </span><span id="local-6989586621681189460"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189460"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681189459"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189459"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance -&gt; Role -&gt; Type -&gt; Type -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkUnivCo"><span class="hs-identifier hs-var">mkUnivCo</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#CorePrepProv"><span class="hs-identifier hs-var">CorePrepProv</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="#local-6989586621681189461"><span class="hs-keyword hs-var">role</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189460"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189459"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-1351"></span><span>
</span><span id="line-1352"></span><span class="hs-comment">-- | Is an argument okay to CPE?</span><span>
</span><span id="line-1353"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#okCpeArg"><span class="hs-identifier hs-type">okCpeArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1354"></span><span class="hs-comment">-- Don't float literals. See Note [ANF-ising literal string arguments].</span><span>
</span><span id="line-1355"></span><span id="okCpeArg"><span class="annot"><span class="annottext">okCpeArg :: CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#okCpeArg"><span class="hs-identifier hs-var hs-var">okCpeArg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1356"></span><span class="hs-comment">-- Do not eta expand a trivial argument</span><span>
</span><span id="line-1357"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#okCpeArg"><span class="hs-identifier hs-var">okCpeArg</span></a></span><span> </span><span id="local-6989586621681189455"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189455"><span class="hs-identifier hs-var">expr</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsTrivial"><span class="hs-identifier hs-var">exprIsTrivial</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189455"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1358"></span><span>
</span><span id="line-1359"></span><span class="hs-comment">-- This is where we arrange that a non-trivial argument is let-bound</span><span>
</span><span id="line-1360"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeArg"><span class="hs-identifier hs-type">cpeArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html#Demand"><span class="hs-identifier hs-type">Demand</span></a></span><span>
</span><span id="line-1361"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreArg"><span class="hs-identifier hs-type">CoreArg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeArg"><span class="hs-identifier hs-type">CpeArg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1362"></span><span id="cpeArg"><span class="annot"><span class="annottext">cpeArg :: CorePrepEnv -&gt; Demand -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeArg"><span class="hs-identifier hs-var hs-var">cpeArg</span></a></span></span><span> </span><span id="local-6989586621681189454"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189454"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189453"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189453"><span class="hs-identifier hs-var">dmd</span></a></span></span><span> </span><span id="local-6989586621681189452"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189452"><span class="hs-identifier hs-var">arg</span></a></span></span><span>
</span><span id="line-1363"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189451"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189451"><span class="hs-identifier hs-var">floats1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189450"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189450"><span class="hs-identifier hs-var">arg1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#cpeRhsE"><span class="hs-identifier hs-var">cpeRhsE</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189454"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189452"><span class="hs-identifier hs-var">arg</span></a></span><span>     </span><span class="hs-comment">-- arg1 can be a lambda</span><span>
</span><span id="line-1364"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189449"><span class="annot"><span class="annottext">arg_ty :: Type
</span><a href="#local-6989586621681189449"><span class="hs-identifier hs-var hs-var">arg_ty</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189450"><span class="hs-identifier hs-var">arg1</span></a></span><span>
</span><span id="line-1365"></span><span>             </span><span id="local-6989586621681189447"><span class="annot"><span class="annottext">is_unlifted :: Bool
</span><a href="#local-6989586621681189447"><span class="hs-identifier hs-var hs-var">is_unlifted</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Bool
Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnliftedType"><span class="hs-identifier hs-var">isUnliftedType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189449"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-1366"></span><span>             </span><span id="local-6989586621681189446"><span class="annot"><span class="annottext">want_float :: Floats -&gt; CpeRhs -&gt; Bool
</span><a href="#local-6989586621681189446"><span class="hs-identifier hs-var hs-var">want_float</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecFlag -&gt; Demand -&gt; Bool -&gt; Floats -&gt; CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#wantFloatNested"><span class="hs-identifier hs-var">wantFloatNested</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189453"><span class="hs-identifier hs-var">dmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189447"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span>
</span><span id="line-1367"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189445"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189445"><span class="hs-identifier hs-var">floats2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189444"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189444"><span class="hs-identifier hs-var">arg2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; Bool
</span><a href="#local-6989586621681189446"><span class="hs-identifier hs-var">want_float</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189451"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189450"><span class="hs-identifier hs-var">arg1</span></a></span><span>
</span><span id="line-1368"></span><span>                            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189451"><span class="hs-identifier hs-var">floats1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189450"><span class="hs-identifier hs-var">arg1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1369"></span><span>                            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; CpeRhs -&gt; UniqSM (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#dontFloat"><span class="hs-identifier hs-var">dontFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189451"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189450"><span class="hs-identifier hs-var">arg1</span></a></span><span>
</span><span id="line-1370"></span><span>                </span><span class="hs-comment">-- Else case: arg1 might have lambdas, and we can't</span><span>
</span><span id="line-1371"></span><span>                </span><span class="hs-comment">--            put them inside a wrapBinds</span><span>
</span><span id="line-1372"></span><span>
</span><span id="line-1373"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#okCpeArg"><span class="hs-identifier hs-var">okCpeArg</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189444"><span class="hs-identifier hs-var">arg2</span></a></span><span>
</span><span id="line-1374"></span><span>         </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189443"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189443"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var">newVar</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189449"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-1375"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189442"><span class="annot"><span class="annottext">arg3 :: CpeRhs
</span><a href="#local-6989586621681189442"><span class="hs-identifier hs-var hs-var">arg3</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var">cpeEtaExpand</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Int
</span><a href="GHC.Core.Opt.Arity.html#exprArity"><span class="hs-identifier hs-var">exprArity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189444"><span class="hs-identifier hs-var">arg2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189444"><span class="hs-identifier hs-var">arg2</span></a></span><span>
</span><span id="line-1376"></span><span>                       </span><span id="local-6989586621681189441"><span class="annot"><span class="annottext">arg_float :: FloatingBind
</span><a href="#local-6989586621681189441"><span class="hs-identifier hs-var hs-var">arg_float</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Demand -&gt; Bool -&gt; Id -&gt; CpeRhs -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#mkFloat"><span class="hs-identifier hs-var">mkFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189453"><span class="hs-identifier hs-var">dmd</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189447"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189443"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189442"><span class="hs-identifier hs-var">arg3</span></a></span><span>
</span><span id="line-1377"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var">addFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189445"><span class="hs-identifier hs-var">floats2</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189441"><span class="hs-identifier hs-var">arg_float</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#varToCoreExpr"><span class="hs-identifier hs-var">varToCoreExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189443"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1378"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; UniqSM (Floats, CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189445"><span class="hs-identifier hs-var">floats2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189444"><span class="hs-identifier hs-var">arg2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1379"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-1380"></span><span>
</span><span id="line-1381"></span><span class="hs-comment">{-
Note [Floating unlifted arguments]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider    C (let v* = expensive in v)

where the &quot;*&quot; indicates &quot;will be demanded&quot;.  Usually v will have been
inlined by now, but let's suppose it hasn't (see #2756).  Then we
do *not* want to get

     let v* = expensive in C v

because that has different strictness.  Hence the use of 'allLazy'.
(NB: the let v* turns into a FloatCase, in mkLocalNonRec.)


------------------------------------------------------------------------------
-- Building the saturated syntax
-- ---------------------------------------------------------------------------

Note [Eta expansion of hasNoBinding things in CorePrep]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
maybeSaturate deals with eta expanding to saturate things that can't deal with
unsaturated applications (identified by 'hasNoBinding', currently just
foreign calls and unboxed tuple/sum constructors).

Historical Note: Note that eta expansion in CorePrep used to be very fragile
due to the &quot;prediction&quot; of CAFfyness that we used to make during tidying.
We previously saturated primop
applications here as well but due to this fragility (see #16846) we now deal
with this another way, as described in Note [Primop wrappers] in GHC.Builtin.PrimOps.
-}</span><span>
</span><span id="line-1412"></span><span>
</span><span id="line-1413"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#maybeSaturate"><span class="hs-identifier hs-type">maybeSaturate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeApp"><span class="hs-identifier hs-type">CpeApp</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span>
</span><span id="line-1414"></span><span id="maybeSaturate"><span class="annot"><span class="annottext">maybeSaturate :: Id -&gt; CpeRhs -&gt; Int -&gt; UniqSM CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#maybeSaturate"><span class="hs-identifier hs-var hs-var">maybeSaturate</span></a></span></span><span> </span><span id="local-6989586621681189439"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189439"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span id="local-6989586621681189438"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189438"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621681189437"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189437"><span class="hs-identifier hs-var">n_args</span></a></span></span><span>
</span><span id="line-1415"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#hasNoBinding"><span class="hs-identifier hs-var">hasNoBinding</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189439"><span class="hs-identifier hs-var">fn</span></a></span><span>        </span><span class="hs-comment">-- There's no binding</span><span>
</span><span id="line-1416"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM CpeRhs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189435"><span class="hs-identifier hs-var">sat_expr</span></a></span><span>
</span><span id="line-1417"></span><span>
</span><span id="line-1418"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1419"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; UniqSM CpeRhs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189438"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1420"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1421"></span><span>    </span><span id="local-6989586621681189434"><span class="annot"><span class="annottext">fn_arity :: Int
</span><a href="#local-6989586621681189434"><span class="hs-identifier hs-var hs-var">fn_arity</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Int
</span><a href="GHC.Types.Id.html#idArity"><span class="hs-identifier hs-var">idArity</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189439"><span class="hs-identifier hs-var">fn</span></a></span><span>
</span><span id="line-1422"></span><span>    </span><span id="local-6989586621681189432"><span class="annot"><span class="annottext">excess_arity :: Int
</span><a href="#local-6989586621681189432"><span class="hs-identifier hs-var hs-var">excess_arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189434"><span class="hs-identifier hs-var">fn_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189437"><span class="hs-identifier hs-var">n_args</span></a></span><span>
</span><span id="line-1423"></span><span>    </span><span id="local-6989586621681189435"><span class="annot"><span class="annottext">sat_expr :: CpeRhs
</span><a href="#local-6989586621681189435"><span class="hs-identifier hs-var hs-var">sat_expr</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var">cpeEtaExpand</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189432"><span class="hs-identifier hs-var">excess_arity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189438"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1424"></span><span>
</span><span id="line-1425"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Simple GHC.Core operations
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1432"></span><span>
</span><span id="line-1433"></span><span class="hs-comment">{-
-- -----------------------------------------------------------------------------
--      Eta reduction
-- -----------------------------------------------------------------------------

Note [Eta expansion]
~~~~~~~~~~~~~~~~~~~~~
Eta expand to match the arity claimed by the binder Remember,
CorePrep must not change arity

Eta expansion might not have happened already, because it is done by
the simplifier only when there at least one lambda already.

NB1:we could refrain when the RHS is trivial (which can happen
    for exported things).  This would reduce the amount of code
    generated (a little) and make things a little words for
    code compiled without -O.  The case in point is data constructor
    wrappers.

NB2: we have to be careful that the result of etaExpand doesn't
   invalidate any of the assumptions that CorePrep is attempting
   to establish.  One possible cause is eta expanding inside of
   an SCC note - we're now careful in etaExpand to make sure the
   SCC is pushed inside any new lambdas that are generated.

Note [Eta expansion and the CorePrep invariants]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It turns out to be much much easier to do eta expansion
*after* the main CorePrep stuff.  But that places constraints
on the eta expander: given a CpeRhs, it must return a CpeRhs.

For example here is what we do not want:
                f = /\a -&gt; g (h 3)      -- h has arity 2
After ANFing we get
                f = /\a -&gt; let s = h 3 in g s
and now we do NOT want eta expansion to give
                f = /\a -&gt; \ y -&gt; (let s = h 3 in g s) y

Instead GHC.Core.Opt.Arity.etaExpand gives
                f = /\a -&gt; \y -&gt; let s = h 3 in g s y

-}</span><span>
</span><span id="line-1475"></span><span>
</span><span id="line-1476"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-type">cpeEtaExpand</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span>
</span><span id="line-1477"></span><span id="cpeEtaExpand"><span class="annot"><span class="annottext">cpeEtaExpand :: Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpeEtaExpand"><span class="hs-identifier hs-var hs-var">cpeEtaExpand</span></a></span></span><span> </span><span id="local-6989586621681189430"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189430"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span id="local-6989586621681189429"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189429"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-1478"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189430"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189429"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1479"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Opt.Arity.html#etaExpand"><span class="hs-identifier hs-var">etaExpand</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189430"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189429"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1480"></span><span>
</span><span id="line-1481"></span><span class="hs-comment">{-
-- -----------------------------------------------------------------------------
--      Eta reduction
-- -----------------------------------------------------------------------------

Why try eta reduction?  Hasn't the simplifier already done eta?
But the simplifier only eta reduces if that leaves something
trivial (like f, or f Int).  But for deLam it would be enough to
get to a partial application:
        case x of { p -&gt; \xs. map f xs }
    ==&gt; case x of { p -&gt; map f }
-}</span><span>
</span><span id="line-1493"></span><span>
</span><span id="line-1494"></span><span class="hs-comment">-- When updating this function, make sure it lines up with</span><span>
</span><span id="line-1495"></span><span class="hs-comment">-- GHC.Core.Utils.tryEtaReduce!</span><span>
</span><span id="line-1496"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-type">tryEtaReducePrep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBndr"><span class="hs-identifier hs-type">CoreBndr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1497"></span><span id="tryEtaReducePrep"><span class="annot"><span class="annottext">tryEtaReducePrep :: [Id] -&gt; CpeRhs -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-var hs-var">tryEtaReducePrep</span></a></span></span><span> </span><span id="local-6989586621681189426"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189426"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621681189425"><span class="annot"><span class="annottext">expr :: CpeRhs
</span><a href="#local-6989586621681189425"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-identifier hs-type">App</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-1498"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
forall b. Expr b -&gt; Bool
</span><a href="#local-6989586621681189424"><span class="hs-identifier hs-var">ok_to_eta_reduce</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189423"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-1499"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189422"><span class="hs-identifier hs-var">n_remaining</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-1500"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#and"><span class="hs-identifier hs-var">and</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; CpeRhs -&gt; Bool) -&gt; [Id] -&gt; [CpeRhs] -&gt; [Bool]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; Bool
forall {b}. Id -&gt; Expr b -&gt; Bool
</span><a href="#local-6989586621681189419"><span class="hs-identifier hs-var">ok</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189426"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189418"><span class="hs-identifier hs-var">last_args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1501"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681189415"><span class="hs-identifier hs-var">fvs_remaining</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189426"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1502"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsHNF"><span class="hs-identifier hs-var">exprIsHNF</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189413"><span class="hs-identifier hs-var">remaining_expr</span></a></span><span>   </span><span class="hs-comment">-- Don't turn value into a non-value</span><span>
</span><span id="line-1503"></span><span>                               </span><span class="hs-comment">-- else the behaviour with 'seq' changes</span><span>
</span><span id="line-1504"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Maybe CpeRhs
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189413"><span class="hs-identifier hs-var">remaining_expr</span></a></span><span>
</span><span id="line-1505"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1506"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681189423"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189423"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189412"><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189412"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; (CpeRhs, [CpeRhs])
forall b. Expr b -&gt; (Expr b, [Expr b])
</span><a href="GHC.Core.html#collectArgs"><span class="hs-identifier hs-var">collectArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189425"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1507"></span><span>    </span><span id="local-6989586621681189413"><span class="annot"><span class="annottext">remaining_expr :: CpeRhs
</span><a href="#local-6989586621681189413"><span class="hs-identifier hs-var hs-var">remaining_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [CpeRhs] -&gt; CpeRhs
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189423"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189410"><span class="hs-identifier hs-var">remaining_args</span></a></span><span>
</span><span id="line-1508"></span><span>    </span><span id="local-6989586621681189415"><span class="annot"><span class="annottext">fvs_remaining :: VarSet
</span><a href="#local-6989586621681189415"><span class="hs-identifier hs-var hs-var">fvs_remaining</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; VarSet
</span><a href="GHC.Core.FVs.html#exprFreeVars"><span class="hs-identifier hs-var">exprFreeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189413"><span class="hs-identifier hs-var">remaining_expr</span></a></span><span>
</span><span id="line-1509"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681189410"><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189410"><span class="hs-identifier hs-var">remaining_args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189418"><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189418"><span class="hs-identifier hs-var">last_args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [CpeRhs] -&gt; ([CpeRhs], [CpeRhs])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681189422"><span class="hs-identifier hs-var">n_remaining</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189412"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-1510"></span><span>    </span><span id="local-6989586621681189422"><span class="annot"><span class="annottext">n_remaining :: Int
</span><a href="#local-6989586621681189422"><span class="hs-identifier hs-var hs-var">n_remaining</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CpeRhs] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CpeRhs]
</span><a href="#local-6989586621681189412"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189426"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-1511"></span><span>
</span><span id="line-1512"></span><span>    </span><span id="local-6989586621681189419"><span class="annot"><span class="annottext">ok :: Id -&gt; Expr b -&gt; Bool
</span><a href="#local-6989586621681189419"><span class="hs-identifier hs-var hs-var">ok</span></a></span></span><span> </span><span id="local-6989586621681189401"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189401"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189400"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189400"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189401"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189400"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-1513"></span><span>    </span><span class="annot"><a href="#local-6989586621681189419"><span class="hs-identifier hs-var">ok</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span>    </span><span class="annot"><span class="annottext">Expr b
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1514"></span><span>
</span><span id="line-1515"></span><span>    </span><span class="hs-comment">-- We can't eta reduce something which must be saturated.</span><span>
</span><span id="line-1516"></span><span>    </span><span id="local-6989586621681189424"><span class="annot"><span class="annottext">ok_to_eta_reduce :: Expr b -&gt; Bool
</span><a href="#local-6989586621681189424"><span class="hs-identifier hs-var hs-var">ok_to_eta_reduce</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681189399"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189399"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#hasNoBinding"><span class="hs-identifier hs-var">hasNoBinding</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189399"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isLinearType"><span class="hs-identifier hs-var">isLinearType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189399"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1517"></span><span>    </span><span class="annot"><a href="#local-6989586621681189424"><span class="hs-identifier hs-var">ok_to_eta_reduce</span></a></span><span> </span><span class="annot"><span class="annottext">Expr b
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-comment">-- Safe. ToDo: generalise</span><span>
</span><span id="line-1518"></span><span>
</span><span id="line-1519"></span><span>
</span><span id="line-1520"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-var">tryEtaReducePrep</span></a></span><span> </span><span id="local-6989586621681189397"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189397"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621681189396"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189396"><span class="hs-identifier hs-var">tickish</span></a></span></span><span> </span><span id="local-6989586621681189395"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189395"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1521"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Bool
forall id. Tickish id -&gt; Bool
</span><a href="GHC.Core.html#tickishFloatable"><span class="hs-identifier hs-var">tickishFloatable</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189396"><span class="hs-identifier hs-var">tickish</span></a></span><span>
</span><span id="line-1522"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CpeRhs -&gt; CpeRhs) -&gt; Maybe CpeRhs -&gt; Maybe CpeRhs
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189396"><span class="hs-identifier hs-var">tickish</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe CpeRhs -&gt; Maybe CpeRhs) -&gt; Maybe CpeRhs -&gt; Maybe CpeRhs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; CpeRhs -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-var">tryEtaReducePrep</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189397"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189395"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1523"></span><span>
</span><span id="line-1524"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#tryEtaReducePrep"><span class="hs-identifier hs-var">tryEtaReducePrep</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CpeRhs
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1525"></span><span>
</span><span id="line-1526"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Floats
*                                                                      *
************************************************************************

Note [Pin demand info on floats]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We pin demand info on floated lets, so that we can see the one-shot thunks.
-}</span><span>
</span><span id="line-1537"></span><span>
</span><span id="line-1538"></span><span class="hs-keyword">data</span><span> </span><span id="FloatingBind"><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-var">FloatingBind</span></a></span></span><span>
</span><span id="line-1539"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="FloatLet"><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span>    </span><span class="hs-comment">-- Rhs of bindings are CpeRhss</span><span>
</span><span id="line-1540"></span><span>                         </span><span class="hs-comment">-- They are always of lifted type;</span><span>
</span><span id="line-1541"></span><span>                         </span><span class="hs-comment">-- unlifted ones are done with FloatCase</span><span>
</span><span id="line-1542"></span><span>
</span><span id="line-1543"></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="FloatCase"><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span></span><span>
</span><span id="line-1544"></span><span>      </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span>         </span><span class="hs-comment">-- Always ok-for-speculation</span><span>
</span><span id="line-1545"></span><span>      </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>              </span><span class="hs-comment">-- Case binder</span><span>
</span><span id="line-1546"></span><span>      </span><span class="annot"><a href="GHC.Core.html#AltCon"><span class="hs-identifier hs-type">AltCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- Single alternative</span><span>
</span><span id="line-1547"></span><span>      </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>            </span><span class="hs-comment">-- Ok-for-speculation; False of a strict,</span><span>
</span><span id="line-1548"></span><span>                      </span><span class="hs-comment">-- but lifted binding</span><span>
</span><span id="line-1549"></span><span>
</span><span id="line-1550"></span><span> </span><span class="hs-comment">-- | See Note [Floating Ticks in CorePrep]</span><span>
</span><span id="line-1551"></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="FloatTick"><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-var">FloatTick</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tickish"><span class="hs-identifier hs-type">Tickish</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1552"></span><span>
</span><span id="line-1553"></span><span class="hs-keyword">data</span><span> </span><span id="Floats"><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Floats"><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-type">OkToSpec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1554"></span><span>
</span><span id="line-1555"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681189388"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1556"></span><span>  </span><span id="local-6989586621681189375"><span class="annot"><span class="annottext">ppr :: FloatingBind -&gt; SDoc
</span><a href="#local-6989586621681189375"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621681189374"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189374"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189374"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1557"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621681189373"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189373"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621681189372"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189372"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681189371"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189371"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621681189370"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189370"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621681189369"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189369"><span class="hs-identifier hs-var">ok</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;case&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189369"><span class="hs-identifier hs-var">ok</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189373"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1558"></span><span>                                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;of&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189372"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;@&quot;</span></span><span>
</span><span id="line-1559"></span><span>                                </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189370"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1560"></span><span>                                   </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">AltCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189371"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-1561"></span><span>                                   </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189371"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189370"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1562"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-type">FloatTick</span></a></span><span> </span><span id="local-6989586621681189365"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189365"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189365"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1563"></span><span>
</span><span id="line-1564"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681189362"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1565"></span><span>  </span><span id="local-6989586621681189359"><span class="annot"><span class="annottext">ppr :: Floats -&gt; SDoc
</span><a href="#local-6989586621681189359"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189358"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189358"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681189357"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189357"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Floats&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OkToSpec -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189358"><span class="hs-identifier hs-var">flag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-1566"></span><span>                         </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(FloatingBind -&gt; SDoc) -&gt; [FloatingBind] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; [FloatingBind]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189357"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1567"></span><span>
</span><span id="line-1568"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681189352"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-type">OkToSpec</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1569"></span><span>  </span><span id="local-6989586621681189351"><span class="annot"><span class="annottext">ppr :: OkToSpec -&gt; SDoc
</span><a href="#local-6989586621681189351"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;OkToSpec&quot;</span></span><span>
</span><span id="line-1570"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;IfUnboxedOk&quot;</span></span><span>
</span><span id="line-1571"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;NotOkToSpec&quot;</span></span><span>
</span><span id="line-1572"></span><span>
</span><span id="line-1573"></span><span class="hs-comment">-- Can we float these binds out of the rhs of a let?  We cache this decision</span><span>
</span><span id="line-1574"></span><span class="hs-comment">-- to avoid having to recompute it in a non-linear way when there are</span><span>
</span><span id="line-1575"></span><span class="hs-comment">-- deeply nested lets.</span><span>
</span><span id="line-1576"></span><span class="hs-keyword">data</span><span> </span><span id="OkToSpec"><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span></span><span>
</span><span id="line-1577"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="OkToSpec"><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span></span><span>           </span><span class="hs-comment">-- Lazy bindings of lifted type</span><span>
</span><span id="line-1578"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="IfUnboxedOk"><span class="annot"><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span></span><span>        </span><span class="hs-comment">-- A mixture of lazy lifted bindings and n</span><span>
</span><span id="line-1579"></span><span>                        </span><span class="hs-comment">-- ok-to-speculate unlifted bindings</span><span>
</span><span id="line-1580"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="NotOkToSpec"><span class="annot"><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span></span><span>        </span><span class="hs-comment">-- Some not-ok-to-speculate unlifted bindings</span><span>
</span><span id="line-1581"></span><span>
</span><span id="line-1582"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkFloat"><span class="hs-identifier hs-type">mkFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html#Demand"><span class="hs-identifier hs-type">Demand</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span>
</span><span id="line-1583"></span><span id="mkFloat"><span class="annot"><span class="annottext">mkFloat :: Demand -&gt; Bool -&gt; Id -&gt; CpeRhs -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#mkFloat"><span class="hs-identifier hs-var hs-var">mkFloat</span></a></span></span><span> </span><span id="local-6989586621681189347"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189347"><span class="hs-identifier hs-var">dmd</span></a></span></span><span> </span><span id="local-6989586621681189346"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189346"><span class="hs-identifier hs-var">is_unlifted</span></a></span></span><span> </span><span id="local-6989586621681189345"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189345"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189344"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-1584"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189343"><span class="hs-identifier hs-var">is_strict</span></a></span><span>
</span><span id="line-1585"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189342"><span class="hs-identifier hs-var">is_hnf</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; Bool -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189345"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprOkForSpeculation"><span class="hs-identifier hs-var">exprOkForSpeculation</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1586"></span><span>    </span><span class="hs-comment">-- Don't make a case for a HNF binding, even if it's strict</span><span>
</span><span id="line-1587"></span><span>    </span><span class="hs-comment">-- Otherwise we get  case (\x -&gt; e) of ...!</span><span>
</span><span id="line-1588"></span><span>
</span><span id="line-1589"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189346"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">exprOkForSpeculation</span><span> </span><span class="hs-identifier">rhs</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">rhs</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1590"></span><span>                  </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; Bool -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189345"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1591"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189342"><span class="hs-identifier hs-var">is_hnf</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189345"><span class="hs-identifier hs-var">bndr</span></a></span><span>                       </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1592"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Demand -&gt; Id
</span><a href="GHC.Types.Id.html#setIdDemandInfo"><span class="hs-identifier hs-var">setIdDemandInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189345"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189347"><span class="hs-identifier hs-var">dmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1593"></span><span>                   </span><span class="hs-comment">-- See Note [Pin demand info on floats]</span><span>
</span><span id="line-1594"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1595"></span><span>    </span><span id="local-6989586621681189342"><span class="annot"><span class="annottext">is_hnf :: Bool
</span><a href="#local-6989586621681189342"><span class="hs-identifier hs-var hs-var">is_hnf</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsHNF"><span class="hs-identifier hs-var">exprIsHNF</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189344"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1596"></span><span>    </span><span id="local-6989586621681189343"><span class="annot"><span class="annottext">is_strict :: Bool
</span><a href="#local-6989586621681189343"><span class="hs-identifier hs-var hs-var">is_strict</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Demand -&gt; Bool
forall s u. JointDmd (Str s) (Use u) -&gt; Bool
</span><a href="GHC.Types.Demand.html#isStrictDmd"><span class="hs-identifier hs-var">isStrictDmd</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189347"><span class="hs-identifier hs-var">dmd</span></a></span><span>
</span><span id="line-1597"></span><span>
</span><span id="line-1598"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-type">emptyFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-1599"></span><span id="emptyFloats"><span class="annot"><span class="annottext">emptyFloats :: Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var hs-var">emptyFloats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec -&gt; OrdList FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span>
</span><span id="line-1600"></span><span>
</span><span id="line-1601"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#isEmptyFloats"><span class="hs-identifier hs-type">isEmptyFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1602"></span><span id="isEmptyFloats"><span class="annot"><span class="annottext">isEmptyFloats :: Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isEmptyFloats"><span class="hs-identifier hs-var hs-var">isEmptyFloats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189336"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189336"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; Bool
forall a. OrdList a -&gt; Bool
</span><a href="GHC.Data.OrdList.html#isNilOL"><span class="hs-identifier hs-var">isNilOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189336"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1603"></span><span>
</span><span id="line-1604"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#wrapBinds"><span class="hs-identifier hs-type">wrapBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeBody"><span class="hs-identifier hs-type">CpeBody</span></a></span><span>
</span><span id="line-1605"></span><span id="wrapBinds"><span class="annot"><span class="annottext">wrapBinds :: Floats -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#wrapBinds"><span class="hs-identifier hs-var hs-var">wrapBinds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189334"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189334"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189333"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189333"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-1606"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatingBind -&gt; CpeRhs -&gt; CpeRhs)
-&gt; CpeRhs -&gt; OrdList FloatingBind -&gt; CpeRhs
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; OrdList a -&gt; b
</span><a href="GHC.Data.OrdList.html#foldrOL"><span class="hs-identifier hs-var">foldrOL</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind -&gt; CpeRhs -&gt; CpeRhs
</span><a href="#local-6989586621681189332"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189333"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189334"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-1607"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1608"></span><span>    </span><span id="local-6989586621681189332"><span class="annot"><span class="annottext">mk_bind :: FloatingBind -&gt; CpeRhs -&gt; CpeRhs
</span><a href="#local-6989586621681189332"><span class="hs-identifier hs-var hs-var">mk_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621681189331"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189331"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681189330"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189330"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681189329"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189329"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681189328"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189328"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189327"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189327"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; Type -&gt; [Alt Id] -&gt; CpeRhs
forall b. Expr b -&gt; b -&gt; Type -&gt; [Alt b] -&gt; Expr b
</span><a href="GHC.Core.html#Case"><span class="hs-identifier hs-var">Case</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189331"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189330"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189327"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189329"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189328"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189327"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1609"></span><span>    </span><span class="annot"><a href="#local-6989586621681189332"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621681189326"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189326"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>               </span><span id="local-6989586621681189325"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189325"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CpeRhs -&gt; CpeRhs
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189326"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189325"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-1610"></span><span>    </span><span class="annot"><a href="#local-6989586621681189332"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-type">FloatTick</span></a></span><span> </span><span id="local-6989586621681189324"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189324"><span class="hs-identifier hs-var">tickish</span></a></span></span><span class="hs-special">)</span><span>           </span><span id="local-6989586621681189323"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189323"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189324"><span class="hs-identifier hs-var">tickish</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189323"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-1611"></span><span>
</span><span id="line-1612"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-type">addFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-1613"></span><span id="addFloat"><span class="annot"><span class="annottext">addFloat :: Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var hs-var">addFloat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189322"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189322"><span class="hs-identifier hs-var">ok_to_spec</span></a></span></span><span> </span><span id="local-6989586621681189321"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189321"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189320"><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189320"><span class="hs-identifier hs-var">new_float</span></a></span></span><span>
</span><span id="line-1614"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec -&gt; OrdList FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OkToSpec -&gt; OkToSpec -&gt; OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189322"><span class="hs-identifier hs-var">ok_to_spec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; OkToSpec
</span><a href="#local-6989586621681189318"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189320"><span class="hs-identifier hs-var">new_float</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189321"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; FloatingBind -&gt; OrdList FloatingBind
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189320"><span class="hs-identifier hs-var">new_float</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1615"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1616"></span><span>    </span><span id="local-6989586621681189318"><span class="annot"><span class="annottext">check :: FloatingBind -&gt; OkToSpec
</span><a href="#local-6989586621681189318"><span class="hs-identifier hs-var hs-var">check</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span>
</span><span id="line-1617"></span><span>    </span><span class="annot"><a href="#local-6989586621681189318"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189316"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189316"><span class="hs-identifier hs-var">ok_for_spec</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1618"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189316"><span class="hs-identifier hs-var">ok_for_spec</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span>
</span><span id="line-1619"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span>
</span><span id="line-1620"></span><span>    </span><span class="annot"><a href="#local-6989586621681189318"><span class="hs-identifier hs-var">check</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-type">FloatTick</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span>
</span><span id="line-1621"></span><span>        </span><span class="hs-comment">-- The ok-for-speculation flag says that it's safe to</span><span>
</span><span id="line-1622"></span><span>        </span><span class="hs-comment">-- float this Case out of a let, and thereby do it more eagerly</span><span>
</span><span id="line-1623"></span><span>        </span><span class="hs-comment">-- We need the top-level flag because it's never ok to float</span><span>
</span><span id="line-1624"></span><span>        </span><span class="hs-comment">-- an unboxed binding to the top level</span><span>
</span><span id="line-1625"></span><span>
</span><span id="line-1626"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#unitFloat"><span class="hs-identifier hs-type">unitFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-1627"></span><span id="unitFloat"><span class="annot"><span class="annottext">unitFloat :: FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#unitFloat"><span class="hs-identifier hs-var hs-var">unitFloat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Floats -&gt; FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#addFloat"><span class="hs-identifier hs-var">addFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="GHC.CoreToStg.Prep.html#emptyFloats"><span class="hs-identifier hs-var">emptyFloats</span></a></span><span>
</span><span id="line-1628"></span><span>
</span><span id="line-1629"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-identifier hs-type">appendFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span>
</span><span id="line-1630"></span><span id="appendFloats"><span class="annot"><span class="annottext">appendFloats :: Floats -&gt; Floats -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#appendFloats"><span class="hs-identifier hs-var hs-var">appendFloats</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189315"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189315"><span class="hs-identifier hs-var">spec1</span></a></span></span><span> </span><span id="local-6989586621681189314"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189314"><span class="hs-identifier hs-var">floats1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189313"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189313"><span class="hs-identifier hs-var">spec2</span></a></span></span><span> </span><span id="local-6989586621681189312"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189312"><span class="hs-identifier hs-var">floats2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1631"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec -&gt; OrdList FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OkToSpec -&gt; OkToSpec -&gt; OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189315"><span class="hs-identifier hs-var">spec1</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189313"><span class="hs-identifier hs-var">spec2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189314"><span class="hs-identifier hs-var">floats1</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
-&gt; OrdList FloatingBind -&gt; OrdList FloatingBind
forall a. OrdList a -&gt; OrdList a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#appOL"><span class="hs-operator hs-var">`appOL`</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189312"><span class="hs-identifier hs-var">floats2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1632"></span><span>
</span><span id="line-1633"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#concatFloats"><span class="hs-identifier hs-type">concatFloats</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span>
</span><span id="line-1634"></span><span id="concatFloats"><span class="annot"><span class="annottext">concatFloats :: [Floats] -&gt; OrdList FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#concatFloats"><span class="hs-identifier hs-var hs-var">concatFloats</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats -&gt; OrdList FloatingBind -&gt; OrdList FloatingBind)
-&gt; OrdList FloatingBind -&gt; [Floats] -&gt; OrdList FloatingBind
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189309"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189309"><span class="hs-identifier hs-var">bs1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189308"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189308"><span class="hs-identifier hs-var">bs2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
-&gt; OrdList FloatingBind -&gt; OrdList FloatingBind
forall a. OrdList a -&gt; OrdList a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#appOL"><span class="hs-identifier hs-var">appOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189309"><span class="hs-identifier hs-var">bs1</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189308"><span class="hs-identifier hs-var">bs2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span>
</span><span id="line-1635"></span><span>
</span><span id="line-1636"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-type">combine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-type">OkToSpec</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-type">OkToSpec</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-type">OkToSpec</span></a></span><span>
</span><span id="line-1637"></span><span id="combine"><span class="annot"><span class="annottext">combine :: OkToSpec -&gt; OkToSpec -&gt; OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var hs-var">combine</span></a></span></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span>
</span><span id="line-1638"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span>
</span><span id="line-1639"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span>
</span><span id="line-1640"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span>
</span><span id="line-1641"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#combine"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span>
</span><span id="line-1642"></span><span>
</span><span id="line-1643"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#deFloatTop"><span class="hs-identifier hs-type">deFloatTop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1644"></span><span class="hs-comment">-- For top level only; we don't expect any FloatCases</span><span>
</span><span id="line-1645"></span><span id="deFloatTop"><span class="annot"><span class="annottext">deFloatTop :: Floats -&gt; CoreProgram
</span><a href="GHC.CoreToStg.Prep.html#deFloatTop"><span class="hs-identifier hs-var hs-var">deFloatTop</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189307"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189307"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1646"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FloatingBind -&gt; CoreProgram -&gt; CoreProgram)
-&gt; CoreProgram -&gt; OrdList FloatingBind -&gt; CoreProgram
forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; OrdList a -&gt; b
</span><a href="GHC.Data.OrdList.html#foldrOL"><span class="hs-identifier hs-var">foldrOL</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681189306"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189307"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-1647"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1648"></span><span>    </span><span id="local-6989586621681189306"><span class="annot"><span class="annottext">get :: FloatingBind -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681189306"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621681189302"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189302"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span>               </span><span id="local-6989586621681189301"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189301"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreBind
</span><a href="#local-6989586621681189300"><span class="hs-identifier hs-var">get_bind</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189302"><span class="hs-identifier hs-var">b</span></a></span><span>                 </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreProgram -&gt; CoreProgram
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189301"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1649"></span><span>    </span><span class="annot"><a href="#local-6989586621681189306"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621681189299"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189299"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681189298"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189298"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189297"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189297"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreBind
</span><a href="#local-6989586621681189300"><span class="hs-identifier hs-var">get_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189298"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189299"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreProgram -&gt; CoreProgram
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681189297"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1650"></span><span>    </span><span class="annot"><a href="#local-6989586621681189306"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span id="local-6989586621681189296"><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189296"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; CoreProgram
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;corePrepPgm&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189296"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1651"></span><span>
</span><span id="line-1652"></span><span>    </span><span class="hs-comment">-- See Note [Dead code in CorePrep]</span><span>
</span><span id="line-1653"></span><span>    </span><span id="local-6989586621681189300"><span class="annot"><span class="annottext">get_bind :: CoreBind -&gt; CoreBind
</span><a href="#local-6989586621681189300"><span class="hs-identifier hs-var hs-var">get_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681189295"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189295"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681189294"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189294"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189295"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier hs-var">occurAnalyseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189294"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1654"></span><span>    </span><span class="annot"><a href="#local-6989586621681189300"><span class="hs-identifier hs-var">get_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681189292"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189292"><span class="hs-identifier hs-var">xes</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189291"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier hs-var">occurAnalyseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189290"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189291"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189291"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189290"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189290"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189292"><span class="hs-identifier hs-var">xes</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1655"></span><span>
</span><span id="line-1656"></span><span class="hs-comment">---------------------------------------------------------------------------</span><span>
</span><span id="line-1657"></span><span>
</span><span id="line-1658"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#canFloat"><span class="hs-identifier hs-type">canFloat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1659"></span><span id="canFloat"><span class="annot"><span class="annottext">canFloat :: Floats -&gt; CpeRhs -&gt; Maybe (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#canFloat"><span class="hs-identifier hs-var hs-var">canFloat</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189289"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189289"><span class="hs-identifier hs-var">ok_to_spec</span></a></span></span><span> </span><span id="local-6989586621681189288"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189288"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189287"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189287"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-1660"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189289"><span class="hs-identifier hs-var">ok_to_spec</span></a></span><span>           </span><span class="hs-comment">-- Worth trying</span><span>
</span><span id="line-1661"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189286"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189286"><span class="hs-identifier hs-var">fs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
-&gt; [FloatingBind] -&gt; Maybe (OrdList FloatingBind)
</span><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; [FloatingBind]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189288"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1662"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Floats, CpeRhs) -&gt; Maybe (Floats, CpeRhs)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OkToSpec -&gt; OrdList FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189286"><span class="hs-identifier hs-var">fs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189287"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1663"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1664"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Floats, CpeRhs)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1665"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1666"></span><span>    </span><span class="annot"><a href="#local-6989586621681189285"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1667"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatingBind"><span class="hs-identifier hs-type">FloatingBind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1668"></span><span>
</span><span id="line-1669"></span><span>    </span><span id="local-6989586621681189285"><span class="annot"><span class="annottext">go :: OrdList FloatingBind
-&gt; [FloatingBind] -&gt; Maybe (OrdList FloatingBind)
</span><a href="#local-6989586621681189285"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189284"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189284"><span class="hs-identifier hs-var">fbs_out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; Maybe (OrdList FloatingBind)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189284"><span class="hs-identifier hs-var">fbs_out</span></a></span><span>
</span><span id="line-1670"></span><span>
</span><span id="line-1671"></span><span>    </span><span class="annot"><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681189283"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189283"><span class="hs-identifier hs-var">fbs_out</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189282"><span class="annot"><span class="annottext">fb :: FloatingBind
</span><a href="#local-6989586621681189282"><span class="hs-identifier hs-var">fb</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189281"><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189281"><span class="hs-identifier hs-var">fbs_in</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1672"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
-&gt; [FloatingBind] -&gt; Maybe (OrdList FloatingBind)
</span><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189283"><span class="hs-identifier hs-var">fbs_out</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; FloatingBind -&gt; OrdList FloatingBind
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189282"><span class="hs-identifier hs-var">fb</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189281"><span class="hs-identifier hs-var">fbs_in</span></a></span><span>
</span><span id="line-1673"></span><span>
</span><span id="line-1674"></span><span>    </span><span class="annot"><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681189280"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189280"><span class="hs-identifier hs-var">fbs_out</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189279"><span class="annot"><span class="annottext">ft :: FloatingBind
</span><a href="#local-6989586621681189279"><span class="hs-identifier hs-var">ft</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-type">FloatTick</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681189278"><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189278"><span class="hs-identifier hs-var">fbs_in</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1675"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
-&gt; [FloatingBind] -&gt; Maybe (OrdList FloatingBind)
</span><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189280"><span class="hs-identifier hs-var">fbs_out</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind -&gt; FloatingBind -&gt; OrdList FloatingBind
forall a. OrdList a -&gt; a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#snocOL"><span class="hs-operator hs-var">`snocOL`</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189279"><span class="hs-identifier hs-var">ft</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189278"><span class="hs-identifier hs-var">fbs_in</span></a></span><span>
</span><span id="line-1676"></span><span>
</span><span id="line-1677"></span><span>    </span><span class="annot"><a href="#local-6989586621681189285"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[FloatingBind]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList FloatingBind)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1678"></span><span>
</span><span id="line-1679"></span><span>
</span><span id="line-1680"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#wantFloatNested"><span class="hs-identifier hs-type">wantFloatNested</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Demand.html#Demand"><span class="hs-identifier hs-type">Demand</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeRhs"><span class="hs-identifier hs-type">CpeRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1681"></span><span id="wantFloatNested"><span class="annot"><span class="annottext">wantFloatNested :: RecFlag -&gt; Demand -&gt; Bool -&gt; Floats -&gt; CpeRhs -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#wantFloatNested"><span class="hs-identifier hs-var hs-var">wantFloatNested</span></a></span></span><span> </span><span id="local-6989586621681189277"><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189277"><span class="hs-identifier hs-var">is_rec</span></a></span></span><span> </span><span id="local-6989586621681189276"><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189276"><span class="hs-identifier hs-var">dmd</span></a></span></span><span> </span><span id="local-6989586621681189275"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189275"><span class="hs-identifier hs-var">is_unlifted</span></a></span></span><span> </span><span id="local-6989586621681189274"><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189274"><span class="hs-identifier hs-var">floats</span></a></span></span><span> </span><span id="local-6989586621681189273"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189273"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-1682"></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#isEmptyFloats"><span class="hs-identifier hs-var">isEmptyFloats</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189274"><span class="hs-identifier hs-var">floats</span></a></span><span>
</span><span id="line-1683"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Demand -&gt; Bool
forall s u. JointDmd (Str s) (Use u) -&gt; Bool
</span><a href="GHC.Types.Demand.html#isStrictDmd"><span class="hs-identifier hs-var">isStrictDmd</span></a></span><span> </span><span class="annot"><span class="annottext">Demand
</span><a href="#local-6989586621681189276"><span class="hs-identifier hs-var">dmd</span></a></span><span>
</span><span id="line-1684"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189275"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span>
</span><span id="line-1685"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecFlag -&gt; Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#allLazyNested"><span class="hs-identifier hs-var">allLazyNested</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189277"><span class="hs-identifier hs-var">is_rec</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><a href="#local-6989586621681189274"><span class="hs-identifier hs-var">floats</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Bool
</span><a href="GHC.Core.Utils.html#exprIsHNF"><span class="hs-identifier hs-var">exprIsHNF</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189273"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1686"></span><span>        </span><span class="hs-comment">-- Why the test for allLazyNested?</span><span>
</span><span id="line-1687"></span><span>        </span><span class="hs-comment">--      v = f (x `divInt#` y)</span><span>
</span><span id="line-1688"></span><span>        </span><span class="hs-comment">-- we don't want to float the case, even if f has arity 2,</span><span>
</span><span id="line-1689"></span><span>        </span><span class="hs-comment">-- because floating the case would make it evaluated too early</span><span>
</span><span id="line-1690"></span><span>
</span><span id="line-1691"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#allLazyTop"><span class="hs-identifier hs-type">allLazyTop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1692"></span><span id="allLazyTop"><span class="annot"><span class="annottext">allLazyTop :: Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#allLazyTop"><span class="hs-identifier hs-var hs-var">allLazyTop</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1693"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#allLazyTop"><span class="hs-identifier hs-var">allLazyTop</span></a></span><span> </span><span class="annot"><span class="annottext">Floats
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1694"></span><span>
</span><span id="line-1695"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#allLazyNested"><span class="hs-identifier hs-type">allLazyNested</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1696"></span><span id="allLazyNested"><span class="annot"><span class="annottext">allLazyNested :: RecFlag -&gt; Floats -&gt; Bool
</span><a href="GHC.CoreToStg.Prep.html#allLazyNested"><span class="hs-identifier hs-var hs-var">allLazyNested</span></a></span></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#OkToSpec"><span class="hs-identifier hs-var">OkToSpec</span></a></span><span>    </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1697"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#allLazyNested"><span class="hs-identifier hs-var">allLazyNested</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#NotOkToSpec"><span class="hs-identifier hs-var">NotOkToSpec</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1698"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#allLazyNested"><span class="hs-identifier hs-var">allLazyNested</span></a></span><span> </span><span id="local-6989586621681189271"><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189271"><span class="hs-identifier hs-var">is_rec</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="GHC.CoreToStg.Prep.html#IfUnboxedOk"><span class="hs-identifier hs-var">IfUnboxedOk</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#isNonRec"><span class="hs-identifier hs-var">isNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">RecFlag
</span><a href="#local-6989586621681189271"><span class="hs-identifier hs-var">is_rec</span></a></span><span>
</span><span id="line-1699"></span><span>
</span><span id="line-1700"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Cloning
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1707"></span><span>
</span><span id="line-1708"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-1709"></span><span class="hs-comment">--                      The environment</span><span>
</span><span id="line-1710"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-1711"></span><span>
</span><span id="line-1712"></span><span class="hs-comment">{- Note [Inlining in CorePrep]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is a subtle but important invariant that must be upheld in the output
of CorePrep: there are no &quot;trivial&quot; updatable thunks.  Thus, this Core
is impermissible:

     let x :: ()
         x = y

(where y is a reference to a GLOBAL variable).  Thunks like this are silly:
they can always be profitably replaced by inlining x with y. Consequently,
the code generator/runtime does not bother implementing this properly
(specifically, there is no implementation of stg_ap_0_upd_info, which is the
stack frame that would be used to update this thunk.  The &quot;0&quot; means it has
zero free variables.)

In general, the inliner is good at eliminating these let-bindings.  However,
there is one case where these trivial updatable thunks can arise: when
we are optimizing away 'lazy' (see Note [lazyId magic], and also
'cpeRhsE'.)  Then, we could have started with:

     let x :: ()
         x = lazy @ () y

which is a perfectly fine, non-trivial thunk, but then CorePrep will
drop 'lazy', giving us 'x = y' which is trivial and impermissible.
The solution is CorePrep to have a miniature inlining pass which deals
with cases like this.  We can then drop the let-binding altogether.

Why does the removal of 'lazy' have to occur in CorePrep?
The gory details are in Note [lazyId magic] in GHC.Types.Id.Make, but the
main reason is that lazy must appear in unfoldings (optimizer
output) and it must prevent call-by-value for catch# (which
is implemented by CorePrep.)

An alternate strategy for solving this problem is to have the
inliner treat 'lazy e' as a trivial expression if 'e' is trivial.
We decided not to adopt this solution to keep the definition
of 'exprIsTrivial' simple.

There is ONE caveat however: for top-level bindings we have
to preserve the binding so that we float the (hacky) non-recursive
binding for data constructors; see Note [Data constructor workers].

Note [CorePrep inlines trivial CoreExpr not Id]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Why does cpe_env need to be an IdEnv CoreExpr, as opposed to an
IdEnv Id?  Naively, we might conjecture that trivial updatable thunks
as per Note [Inlining in CorePrep] always have the form
'lazy @ SomeType gbl_id'.  But this is not true: the following is
perfectly reasonable Core:

     let x :: ()
         x = lazy @ (forall a. a) y @ Bool

When we inline 'x' after eliminating 'lazy', we need to replace
occurrences of 'x' with 'y @ bool', not just 'y'.  Situations like
this can easily arise with higher-rank types; thus, cpe_env must
map to CoreExprs, not Ids.

-}</span><span>
</span><span id="line-1773"></span><span>
</span><span id="line-1774"></span><span class="hs-keyword">data</span><span> </span><span id="CorePrepEnv"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-var">CorePrepEnv</span></a></span></span><span>
</span><span id="line-1775"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="CPE"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-var">CPE</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="cpe_dynFlags"><span class="annot"><span class="annottext">CorePrepEnv -&gt; DynFlags
</span><a href="GHC.CoreToStg.Prep.html#cpe_dynFlags"><span class="hs-identifier hs-var hs-var">cpe_dynFlags</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-1776"></span><span>        </span><span class="hs-special">,</span><span> </span><span id="cpe_env"><span class="annot"><span class="annottext">CorePrepEnv -&gt; IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var hs-var">cpe_env</span></a></span></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>   </span><span class="hs-comment">-- Clone local Ids</span><span>
</span><span id="line-1777"></span><span>        </span><span class="hs-comment">-- ^ This environment is used for three operations:</span><span>
</span><span id="line-1778"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-1779"></span><span>        </span><span class="hs-comment">--      1. To support cloning of local Ids so that they are</span><span>
</span><span id="line-1780"></span><span>        </span><span class="hs-comment">--      all unique (see item (6) of CorePrep overview).</span><span>
</span><span id="line-1781"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-1782"></span><span>        </span><span class="hs-comment">--      2. To support beta-reduction of runRW, see</span><span>
</span><span id="line-1783"></span><span>        </span><span class="hs-comment">--      Note [runRW magic] and Note [runRW arg].</span><span>
</span><span id="line-1784"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-1785"></span><span>        </span><span class="hs-comment">--      3. To let us inline trivial RHSs of non top-level let-bindings,</span><span>
</span><span id="line-1786"></span><span>        </span><span class="hs-comment">--      see Note [lazyId magic], Note [Inlining in CorePrep]</span><span>
</span><span id="line-1787"></span><span>        </span><span class="hs-comment">--      and Note [CorePrep inlines trivial CoreExpr not Id] (#12076)</span><span>
</span><span id="line-1788"></span><span>
</span><span id="line-1789"></span><span>        </span><span class="hs-special">,</span><span> </span><span id="cpe_tyco_env"><span class="annot"><span class="annottext">CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var hs-var">cpe_tyco_env</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-comment">-- See Note [CpeTyCoEnv]</span><span>
</span><span id="line-1790"></span><span>
</span><span id="line-1791"></span><span>        </span><span class="hs-special">,</span><span> </span><span id="cpe_convertNumLit"><span class="annot"><span class="annottext">CorePrepEnv -&gt; LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_convertNumLit"><span class="hs-identifier hs-var hs-var">cpe_convertNumLit</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#LitNumType"><span class="hs-identifier hs-type">LitNumType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1792"></span><span>        </span><span class="hs-comment">-- ^ Convert some numeric literals (Integer, Natural) into their</span><span>
</span><span id="line-1793"></span><span>        </span><span class="hs-comment">-- final Core form</span><span>
</span><span id="line-1794"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-1795"></span><span>
</span><span id="line-1796"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkInitialCorePrepEnv"><span class="hs-identifier hs-type">mkInitialCorePrepEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1797"></span><span id="mkInitialCorePrepEnv"><span class="annot"><span class="annottext">mkInitialCorePrepEnv :: HscEnv -&gt; IO CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#mkInitialCorePrepEnv"><span class="hs-identifier hs-var hs-var">mkInitialCorePrepEnv</span></a></span></span><span> </span><span id="local-6989586621681189266"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189266"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1798"></span><span>   </span><span id="local-6989586621681189265"><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189265"><span class="hs-identifier hs-var">convertNumLit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO (LitNumType -&gt; Integer -&gt; Maybe CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#mkConvertNumLiteral"><span class="hs-identifier hs-var">mkConvertNumLiteral</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189266"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1799"></span><span>   </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; IO CorePrepEnv
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv -&gt; IO CorePrepEnv) -&gt; CorePrepEnv -&gt; IO CorePrepEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CPE :: DynFlags
-&gt; IdEnv CpeRhs
-&gt; Maybe CpeTyCoEnv
-&gt; (LitNumType -&gt; Integer -&gt; Maybe CpeRhs)
-&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span>
</span><span id="line-1800"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_dynFlags :: DynFlags
</span><a href="GHC.CoreToStg.Prep.html#cpe_dynFlags"><span class="hs-identifier hs-var">cpe_dynFlags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189266"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-1801"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cpe_env :: IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var">cpe_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv CpeRhs
forall a. VarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyVarEnv"><span class="hs-identifier hs-var">emptyVarEnv</span></a></span><span>
</span><span id="line-1802"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1803"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">cpe_convertNumLit :: LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_convertNumLit"><span class="hs-identifier hs-var">cpe_convertNumLit</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189265"><span class="hs-identifier hs-var">convertNumLit</span></a></span><span>
</span><span id="line-1804"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-1805"></span><span>
</span><span id="line-1806"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnv"><span class="hs-identifier hs-type">extendCorePrepEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1807"></span><span id="extendCorePrepEnv"><span class="annot"><span class="annottext">extendCorePrepEnv :: CorePrepEnv -&gt; Id -&gt; Id -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnv"><span class="hs-identifier hs-var hs-var">extendCorePrepEnv</span></a></span></span><span> </span><span id="local-6989586621681189263"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189263"><span class="hs-identifier hs-var">cpe</span></a></span></span><span> </span><span id="local-6989586621681189262"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189262"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681189261"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189261"><span class="hs-identifier hs-var">id'</span></a></span></span><span>
</span><span id="line-1808"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189263"><span class="hs-identifier hs-var">cpe</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_env :: IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var">cpe_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv CpeRhs -&gt; Id -&gt; CpeRhs -&gt; IdEnv CpeRhs
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var hs-var">cpe_env</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189263"><span class="hs-identifier hs-var">cpe</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189262"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189261"><span class="hs-identifier hs-var">id'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1809"></span><span>
</span><span id="line-1810"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvExpr"><span class="hs-identifier hs-type">extendCorePrepEnvExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1811"></span><span id="extendCorePrepEnvExpr"><span class="annot"><span class="annottext">extendCorePrepEnvExpr :: CorePrepEnv -&gt; Id -&gt; CpeRhs -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvExpr"><span class="hs-identifier hs-var hs-var">extendCorePrepEnvExpr</span></a></span></span><span> </span><span id="local-6989586621681189259"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189259"><span class="hs-identifier hs-var">cpe</span></a></span></span><span> </span><span id="local-6989586621681189258"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189258"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681189257"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189257"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-1812"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189259"><span class="hs-identifier hs-var">cpe</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_env :: IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var">cpe_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv CpeRhs -&gt; Id -&gt; CpeRhs -&gt; IdEnv CpeRhs
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var hs-var">cpe_env</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189259"><span class="hs-identifier hs-var">cpe</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189258"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189257"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1813"></span><span>
</span><span id="line-1814"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvList"><span class="hs-identifier hs-type">extendCorePrepEnvList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1815"></span><span id="extendCorePrepEnvList"><span class="annot"><span class="annottext">extendCorePrepEnvList :: CorePrepEnv -&gt; [(Id, Id)] -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnvList"><span class="hs-identifier hs-var hs-var">extendCorePrepEnvList</span></a></span></span><span> </span><span id="local-6989586621681189256"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189256"><span class="hs-identifier hs-var">cpe</span></a></span></span><span> </span><span id="local-6989586621681189255"><span class="annot"><span class="annottext">[(Id, Id)]
</span><a href="#local-6989586621681189255"><span class="hs-identifier hs-var">prs</span></a></span></span><span>
</span><span id="line-1816"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189256"><span class="hs-identifier hs-var">cpe</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_env :: IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var">cpe_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv CpeRhs -&gt; [(Id, CpeRhs)] -&gt; IdEnv CpeRhs
forall a. VarEnv a -&gt; [(Id, a)] -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnvList"><span class="hs-identifier hs-var">extendVarEnvList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var hs-var">cpe_env</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189256"><span class="hs-identifier hs-var">cpe</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1817"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id, Id) -&gt; (Id, CpeRhs)) -&gt; [(Id, Id)] -&gt; [(Id, CpeRhs)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681189253"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189253"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189252"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189252"><span class="hs-identifier hs-var">id'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189253"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189252"><span class="hs-identifier hs-var">id'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Id, Id)]
</span><a href="#local-6989586621681189255"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1818"></span><span>
</span><span id="line-1819"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#lookupCorePrepEnv"><span class="hs-identifier hs-type">lookupCorePrepEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1820"></span><span id="lookupCorePrepEnv"><span class="annot"><span class="annottext">lookupCorePrepEnv :: CorePrepEnv -&gt; Id -&gt; CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#lookupCorePrepEnv"><span class="hs-identifier hs-var hs-var">lookupCorePrepEnv</span></a></span></span><span> </span><span id="local-6989586621681189251"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189251"><span class="hs-identifier hs-var">cpe</span></a></span></span><span> </span><span id="local-6989586621681189250"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189250"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-1821"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IdEnv CpeRhs -&gt; Id -&gt; Maybe CpeRhs
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; IdEnv CpeRhs
</span><a href="GHC.CoreToStg.Prep.html#cpe_env"><span class="hs-identifier hs-var hs-var">cpe_env</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189251"><span class="hs-identifier hs-var">cpe</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189250"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1822"></span><span>        </span><span class="annot"><span class="annottext">Maybe CpeRhs
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189250"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1823"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189248"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189248"><span class="hs-identifier hs-var">exp</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189248"><span class="hs-identifier hs-var">exp</span></a></span><span>
</span><span id="line-1824"></span><span>
</span><span id="line-1825"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-1826"></span><span class="hs-comment">--           CpeTyCoEnv</span><span>
</span><span id="line-1827"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-1828"></span><span>
</span><span id="line-1829"></span><span class="hs-comment">{- Note [CpeTyCoEnv]
~~~~~~~~~~~~~~~~~~~~
The cpe_tyco_env :: Maybe CpeTyCoEnv field carries a substitution
for type and coercion varibles

* We need the coercion substitution to support the elimination of
  unsafeEqualityProof (see Note [Unsafe coercions])

* We need the type substitution in case one of those unsafe
  coercions occurs in the kind of tyvar binder (sigh)

We don't need an in-scope set because we don't clone any of these
binders at all, so no new capture can take place.

The cpe_tyco_env is almost always empty -- it only gets populated
when we get under an usafeEqualityProof.  Hence the Maybe CpeTyCoEnv,
which makes everything into a no-op in the common case.
-}</span><span>
</span><span id="line-1847"></span><span>
</span><span id="line-1848"></span><span class="hs-keyword">data</span><span> </span><span id="CpeTyCoEnv"><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-var">CpeTyCoEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TCE"><span class="annot"><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-var">TCE</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TvSubstEnv"><span class="hs-identifier hs-type">TvSubstEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#CvSubstEnv"><span class="hs-identifier hs-type">CvSubstEnv</span></a></span><span>
</span><span id="line-1849"></span><span>
</span><span id="line-1850"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#emptyTCE"><span class="hs-identifier hs-type">emptyTCE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span>
</span><span id="line-1851"></span><span id="emptyTCE"><span class="annot"><span class="annottext">emptyTCE :: CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#emptyTCE"><span class="hs-identifier hs-var hs-var">emptyTCE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TvSubstEnv -&gt; CvSubstEnv -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-var">TCE</span></a></span><span> </span><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="GHC.Core.TyCo.Subst.html#emptyTvSubstEnv"><span class="hs-identifier hs-var">emptyTvSubstEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="GHC.Core.TyCo.Subst.html#emptyCvSubstEnv"><span class="hs-identifier hs-var">emptyCvSubstEnv</span></a></span><span>
</span><span id="line-1852"></span><span>
</span><span id="line-1853"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extend_tce_cv"><span class="hs-identifier hs-type">extend_tce_cv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span>
</span><span id="line-1854"></span><span id="extend_tce_cv"><span class="annot"><span class="annottext">extend_tce_cv :: CpeTyCoEnv -&gt; Id -&gt; Coercion -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#extend_tce_cv"><span class="hs-identifier hs-var hs-var">extend_tce_cv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-type">TCE</span></a></span><span> </span><span id="local-6989586621681189241"><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189241"><span class="hs-identifier hs-var">tv_env</span></a></span></span><span> </span><span id="local-6989586621681189240"><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189240"><span class="hs-identifier hs-var">cv_env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189239"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189239"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span id="local-6989586621681189238"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189238"><span class="hs-identifier hs-var">co</span></a></span></span><span>
</span><span id="line-1855"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TvSubstEnv -&gt; CvSubstEnv -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-var">TCE</span></a></span><span> </span><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189241"><span class="hs-identifier hs-var">tv_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CvSubstEnv -&gt; Id -&gt; Coercion -&gt; CvSubstEnv
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189240"><span class="hs-identifier hs-var">cv_env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189239"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189238"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1856"></span><span>
</span><span id="line-1857"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extend_tce_tv"><span class="hs-identifier hs-type">extend_tce_tv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span>
</span><span id="line-1858"></span><span id="extend_tce_tv"><span class="annot"><span class="annottext">extend_tce_tv :: CpeTyCoEnv -&gt; Id -&gt; Type -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#extend_tce_tv"><span class="hs-identifier hs-var hs-var">extend_tce_tv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-type">TCE</span></a></span><span> </span><span id="local-6989586621681189235"><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189235"><span class="hs-identifier hs-var">tv_env</span></a></span></span><span> </span><span id="local-6989586621681189234"><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189234"><span class="hs-identifier hs-var">cv_env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189233"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189233"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621681189232"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189232"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1859"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TvSubstEnv -&gt; CvSubstEnv -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-var">TCE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TvSubstEnv -&gt; Id -&gt; Type -&gt; TvSubstEnv
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189235"><span class="hs-identifier hs-var">tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189233"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189232"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189234"><span class="hs-identifier hs-var">cv_env</span></a></span><span>
</span><span id="line-1860"></span><span>
</span><span id="line-1861"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#lookup_tce_cv"><span class="hs-identifier hs-type">lookup_tce_cv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-1862"></span><span id="lookup_tce_cv"><span class="annot"><span class="annottext">lookup_tce_cv :: CpeTyCoEnv -&gt; Id -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#lookup_tce_cv"><span class="hs-identifier hs-var hs-var">lookup_tce_cv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-type">TCE</span></a></span><span> </span><span class="annot"><span class="annottext">TvSubstEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189230"><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189230"><span class="hs-identifier hs-var">cv_env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189229"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189229"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-1863"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CvSubstEnv -&gt; Id -&gt; Maybe Coercion
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CvSubstEnv
</span><a href="#local-6989586621681189230"><span class="hs-identifier hs-var">cv_env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189229"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1864"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189228"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189228"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189228"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-1865"></span><span>        </span><span class="annot"><span class="annottext">Maybe Coercion
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkCoVarCo"><span class="hs-identifier hs-var">mkCoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189229"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-1866"></span><span>
</span><span id="line-1867"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#lookup_tce_tv"><span class="hs-identifier hs-type">lookup_tce_tv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1868"></span><span id="lookup_tce_tv"><span class="annot"><span class="annottext">lookup_tce_tv :: CpeTyCoEnv -&gt; Id -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#lookup_tce_tv"><span class="hs-identifier hs-var hs-var">lookup_tce_tv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#TCE"><span class="hs-identifier hs-type">TCE</span></a></span><span> </span><span id="local-6989586621681189225"><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189225"><span class="hs-identifier hs-var">tv_env</span></a></span></span><span> </span><span class="annot"><span class="annottext">CvSubstEnv
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189224"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189224"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-1869"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TvSubstEnv -&gt; Id -&gt; Maybe Type
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TvSubstEnv
</span><a href="#local-6989586621681189225"><span class="hs-identifier hs-var">tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189224"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1870"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189223"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189223"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189223"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1871"></span><span>        </span><span class="annot"><span class="annottext">Maybe Type
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189224"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1872"></span><span>
</span><span id="line-1873"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#extendCoVarEnv"><span class="hs-identifier hs-type">extendCoVarEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span>
</span><span id="line-1874"></span><span id="extendCoVarEnv"><span class="annot"><span class="annottext">extendCoVarEnv :: CorePrepEnv -&gt; Id -&gt; Coercion -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCoVarEnv"><span class="hs-identifier hs-var hs-var">extendCoVarEnv</span></a></span></span><span> </span><span id="local-6989586621681189221"><span class="annot"><span class="annottext">cpe :: CorePrepEnv
</span><a href="#local-6989586621681189221"><span class="hs-identifier hs-var">cpe</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681189220"><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189220"><span class="hs-identifier hs-var">mb_tce</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189219"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189219"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span id="local-6989586621681189218"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189218"><span class="hs-identifier hs-var">co</span></a></span></span><span>
</span><span id="line-1875"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189221"><span class="hs-identifier hs-var">cpe</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Maybe CpeTyCoEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; Coercion -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#extend_tce_cv"><span class="hs-identifier hs-var">extend_tce_cv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189217"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189219"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189218"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1876"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1877"></span><span>    </span><span id="local-6989586621681189217"><span class="annot"><span class="annottext">tce :: CpeTyCoEnv
</span><a href="#local-6989586621681189217"><span class="hs-identifier hs-var hs-var">tce</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189220"><span class="hs-identifier hs-var">mb_tce</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv -&gt; CpeTyCoEnv -&gt; CpeTyCoEnv
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#emptyTCE"><span class="hs-identifier hs-var">emptyTCE</span></a></span><span>
</span><span id="line-1878"></span><span>
</span><span id="line-1879"></span><span>
</span><span id="line-1880"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-type">cpSubstTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1881"></span><span id="cpSubstTy"><span class="annot"><span class="annottext">cpSubstTy :: CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var hs-var">cpSubstTy</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681189215"><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189215"><span class="hs-identifier hs-var">mb_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189214"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189214"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1882"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189215"><span class="hs-identifier hs-var">mb_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1883"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189213"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189213"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Identity Type -&gt; Type
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Type -&gt; Identity Type
</span><a href="GHC.CoreToStg.Prep.html#subst_ty"><span class="hs-identifier hs-var">subst_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189213"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189214"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1884"></span><span>      </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189214"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1885"></span><span>
</span><span id="line-1886"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-type">cpSubstCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-1887"></span><span id="cpSubstCo"><span class="annot"><span class="annottext">cpSubstCo :: CorePrepEnv -&gt; Coercion -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCo"><span class="hs-identifier hs-var hs-var">cpSubstCo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681189210"><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189210"><span class="hs-identifier hs-var">mb_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189209"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189209"><span class="hs-identifier hs-var">co</span></a></span></span><span>
</span><span id="line-1888"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189210"><span class="hs-identifier hs-var">mb_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1889"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189208"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189208"><span class="hs-identifier hs-var">tce</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Identity Coercion -&gt; Coercion
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Coercion -&gt; Identity Coercion
</span><a href="GHC.CoreToStg.Prep.html#subst_co"><span class="hs-identifier hs-var">subst_co</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189208"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189209"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1890"></span><span>      </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621681189209"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-1891"></span><span>
</span><span id="line-1892"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#subst_tyco_mapper"><span class="hs-identifier hs-type">subst_tyco_mapper</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#TyCoMapper"><span class="hs-identifier hs-type">TyCoMapper</span></a></span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span>
</span><span id="line-1893"></span><span id="subst_tyco_mapper"><span class="annot"><span class="annottext">subst_tyco_mapper :: TyCoMapper CpeTyCoEnv Identity
</span><a href="GHC.CoreToStg.Prep.html#subst_tyco_mapper"><span class="hs-identifier hs-var hs-var">subst_tyco_mapper</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoMapper :: forall env (m :: * -&gt; *).
(env -&gt; Id -&gt; m Type)
-&gt; (env -&gt; Id -&gt; m Coercion)
-&gt; (env -&gt; CoercionHole -&gt; m Coercion)
-&gt; (env -&gt; Id -&gt; ArgFlag -&gt; m (env, Id))
-&gt; (TyCon -&gt; m TyCon)
-&gt; TyCoMapper env m
</span><a href="GHC.Core.Type.html#TyCoMapper"><span class="hs-identifier hs-type">TyCoMapper</span></a></span><span>
</span><span id="line-1894"></span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcm_tyvar :: CpeTyCoEnv -&gt; Id -&gt; Identity Type
</span><a href="GHC.Core.Type.html#tcm_tyvar"><span class="hs-identifier hs-var">tcm_tyvar</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681189203"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189203"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189202"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189202"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Identity Type
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#lookup_tce_tv"><span class="hs-identifier hs-var">lookup_tce_tv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189203"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189202"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1895"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcm_covar :: CpeTyCoEnv -&gt; Id -&gt; Identity Coercion
</span><a href="GHC.Core.Type.html#tcm_covar"><span class="hs-identifier hs-var">tcm_covar</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681189200"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189200"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189199"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189199"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; Identity Coercion
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; Coercion
</span><a href="GHC.CoreToStg.Prep.html#lookup_tce_cv"><span class="hs-identifier hs-var">lookup_tce_cv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189200"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189199"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1896"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcm_hole :: CpeTyCoEnv -&gt; CoercionHole -&gt; Identity Coercion
</span><a href="GHC.Core.Type.html#tcm_hole"><span class="hs-identifier hs-var">tcm_hole</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189197"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621681189197"><span class="hs-identifier hs-var">hole</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Identity Coercion
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;subst_co_mapper:hole&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoercionHole -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621681189197"><span class="hs-identifier hs-var">hole</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1897"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcm_tycobinder :: CpeTyCoEnv -&gt; Id -&gt; ArgFlag -&gt; Identity (CpeTyCoEnv, Id)
</span><a href="GHC.Core.Type.html#tcm_tycobinder"><span class="hs-identifier hs-var">tcm_tycobinder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681189195"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189195"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189194"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189194"><span class="hs-identifier hs-var">tcv</span></a></span></span><span> </span><span id="local-6989586621681189193"><span class="annot"><span class="annottext">ArgFlag
</span><a href="#local-6989586621681189193"><span class="hs-identifier hs-var">_vis</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189194"><span class="hs-identifier hs-var">tcv</span></a></span><span>
</span><span id="line-1898"></span><span>                                      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(CpeTyCoEnv, Id) -&gt; Identity (CpeTyCoEnv, Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_tv_bndr"><span class="hs-identifier hs-var">subst_tv_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189195"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189194"><span class="hs-identifier hs-var">tcv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1899"></span><span>                                      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(CpeTyCoEnv, Id) -&gt; Identity (CpeTyCoEnv, Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_cv_bndr"><span class="hs-identifier hs-var">subst_cv_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189195"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189194"><span class="hs-identifier hs-var">tcv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1900"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcm_tycon :: TyCon -&gt; Identity TyCon
</span><a href="GHC.Core.Type.html#tcm_tycon"><span class="hs-identifier hs-var">tcm_tycon</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681189189"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681189189"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Identity TyCon
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681189189"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1901"></span><span>
</span><span id="line-1902"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#subst_ty"><span class="hs-identifier hs-type">subst_ty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-1903"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#subst_co"><span class="hs-identifier hs-type">subst_co</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>
</span><span id="line-1904"></span><span class="hs-special">(</span><span id="subst_ty"><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Type -&gt; Identity Type
</span><a href="GHC.CoreToStg.Prep.html#subst_ty"><span class="hs-identifier hs-var">subst_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; [Type] -&gt; Identity [Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="subst_co"><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Coercion -&gt; Identity Coercion
</span><a href="GHC.CoreToStg.Prep.html#subst_co"><span class="hs-identifier hs-var">subst_co</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; [Coercion] -&gt; Identity [Coercion]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoMapper CpeTyCoEnv Identity
-&gt; (CpeTyCoEnv -&gt; Type -&gt; Identity Type,
    CpeTyCoEnv -&gt; [Type] -&gt; Identity [Type],
    CpeTyCoEnv -&gt; Coercion -&gt; Identity Coercion,
    CpeTyCoEnv -&gt; [Coercion] -&gt; Identity [Coercion])
forall (m :: * -&gt; *) env.
Monad m =&gt;
TyCoMapper env m
-&gt; (env -&gt; Type -&gt; m Type, env -&gt; [Type] -&gt; m [Type],
    env -&gt; Coercion -&gt; m Coercion, env -&gt; [Coercion] -&gt; m [Coercion])
</span><a href="GHC.Core.Type.html#mapTyCoX"><span class="hs-identifier hs-var">mapTyCoX</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoMapper CpeTyCoEnv Identity
</span><a href="GHC.CoreToStg.Prep.html#subst_tyco_mapper"><span class="hs-identifier hs-var">subst_tyco_mapper</span></a></span><span>
</span><span id="line-1905"></span><span>
</span><span id="line-1906"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpSubstTyVarBndr"><span class="hs-identifier hs-type">cpSubstTyVarBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1907"></span><span id="cpSubstTyVarBndr"><span class="annot"><span class="annottext">cpSubstTyVarBndr :: CorePrepEnv -&gt; Id -&gt; (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTyVarBndr"><span class="hs-identifier hs-var hs-var">cpSubstTyVarBndr</span></a></span></span><span> </span><span id="local-6989586621681189185"><span class="annot"><span class="annottext">env :: CorePrepEnv
</span><a href="#local-6989586621681189185"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681189184"><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189184"><span class="hs-identifier hs-var">mb_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189183"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189183"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-1908"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189184"><span class="hs-identifier hs-var">mb_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1909"></span><span>      </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189185"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189183"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1910"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189182"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189182"><span class="hs-identifier hs-var">tce</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189185"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Maybe CpeTyCoEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189181"><span class="hs-identifier hs-var">tce'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189180"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1911"></span><span>               </span><span class="hs-keyword">where</span><span>
</span><span id="line-1912"></span><span>                  </span><span class="hs-special">(</span><span id="local-6989586621681189181"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189181"><span class="hs-identifier hs-var">tce'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189180"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189180"><span class="hs-identifier hs-var">tv'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_tv_bndr"><span class="hs-identifier hs-var">subst_tv_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189182"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189183"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1913"></span><span>
</span><span id="line-1914"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#subst_tv_bndr"><span class="hs-identifier hs-type">subst_tv_bndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1915"></span><span id="subst_tv_bndr"><span class="annot"><span class="annottext">subst_tv_bndr :: CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_tv_bndr"><span class="hs-identifier hs-var hs-var">subst_tv_bndr</span></a></span></span><span> </span><span id="local-6989586621681189179"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189179"><span class="hs-identifier hs-var">tce</span></a></span></span><span> </span><span id="local-6989586621681189178"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189178"><span class="hs-identifier hs-var">tv</span></a></span></span><span>
</span><span id="line-1916"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; Type -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#extend_tce_tv"><span class="hs-identifier hs-var">extend_tce_tv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189179"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189178"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189177"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189177"><span class="hs-identifier hs-var">tv'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1917"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1918"></span><span>    </span><span id="local-6989586621681189177"><span class="annot"><span class="annottext">tv' :: Id
</span><a href="#local-6989586621681189177"><span class="hs-identifier hs-var hs-var">tv'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Var.html#mkTyVar"><span class="hs-identifier hs-var">mkTyVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#tyVarName"><span class="hs-identifier hs-var">tyVarName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189178"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189174"><span class="hs-identifier hs-var">kind'</span></a></span><span>
</span><span id="line-1919"></span><span>    </span><span id="local-6989586621681189174"><span class="annot"><span class="annottext">kind' :: Type
</span><a href="#local-6989586621681189174"><span class="hs-identifier hs-var hs-var">kind'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Identity Type -&gt; Type
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="annot"><span class="annottext">(Identity Type -&gt; Type) -&gt; Identity Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Type -&gt; Identity Type
</span><a href="GHC.CoreToStg.Prep.html#subst_ty"><span class="hs-identifier hs-var">subst_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189179"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Identity Type) -&gt; Type -&gt; Identity Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189178"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1920"></span><span>
</span><span id="line-1921"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpSubstCoVarBndr"><span class="hs-identifier hs-type">cpSubstCoVarBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1922"></span><span id="cpSubstCoVarBndr"><span class="annot"><span class="annottext">cpSubstCoVarBndr :: CorePrepEnv -&gt; Id -&gt; (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCoVarBndr"><span class="hs-identifier hs-var hs-var">cpSubstCoVarBndr</span></a></span></span><span> </span><span id="local-6989586621681189171"><span class="annot"><span class="annottext">env :: CorePrepEnv
</span><a href="#local-6989586621681189171"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CPE"><span class="hs-identifier hs-type">CPE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: CorePrepEnv -&gt; Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681189170"><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189170"><span class="hs-identifier hs-var">mb_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189169"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189169"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-1923"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="#local-6989586621681189170"><span class="hs-identifier hs-var">mb_env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1924"></span><span>      </span><span class="annot"><span class="annottext">Maybe CpeTyCoEnv
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189171"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189169"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1925"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681189168"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189168"><span class="hs-identifier hs-var">tce</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189171"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cpe_tyco_env :: Maybe CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#cpe_tyco_env"><span class="hs-identifier hs-var">cpe_tyco_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Maybe CpeTyCoEnv
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189167"><span class="hs-identifier hs-var">tce'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189166"><span class="hs-identifier hs-var">cv'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1926"></span><span>               </span><span class="hs-keyword">where</span><span>
</span><span id="line-1927"></span><span>                  </span><span class="hs-special">(</span><span id="local-6989586621681189167"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189167"><span class="hs-identifier hs-var">tce'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189166"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189166"><span class="hs-identifier hs-var">cv'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_cv_bndr"><span class="hs-identifier hs-var">subst_cv_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189168"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189169"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-1928"></span><span>
</span><span id="line-1929"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#subst_cv_bndr"><span class="hs-identifier hs-type">subst_cv_bndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CpeTyCoEnv"><span class="hs-identifier hs-type">CpeTyCoEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1930"></span><span id="subst_cv_bndr"><span class="annot"><span class="annottext">subst_cv_bndr :: CpeTyCoEnv -&gt; Id -&gt; (CpeTyCoEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#subst_cv_bndr"><span class="hs-identifier hs-var hs-var">subst_cv_bndr</span></a></span></span><span> </span><span id="local-6989586621681189165"><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189165"><span class="hs-identifier hs-var">tce</span></a></span></span><span> </span><span id="local-6989586621681189164"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189164"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-1931"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Id -&gt; Coercion -&gt; CpeTyCoEnv
</span><a href="GHC.CoreToStg.Prep.html#extend_tce_cv"><span class="hs-identifier hs-var">extend_tce_cv</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189165"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189164"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Coercion
</span><a href="GHC.Core.Coercion.html#mkCoVarCo"><span class="hs-identifier hs-var">mkCoVarCo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189163"><span class="hs-identifier hs-var">cv'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189163"><span class="hs-identifier hs-var">cv'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1932"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1933"></span><span>    </span><span id="local-6989586621681189163"><span class="annot"><span class="annottext">cv' :: Id
</span><a href="#local-6989586621681189163"><span class="hs-identifier hs-var hs-var">cv'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Type -&gt; Id
</span><a href="GHC.Types.Var.html#mkCoVar"><span class="hs-identifier hs-var">mkCoVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Var.html#varName"><span class="hs-identifier hs-var hs-var">varName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189164"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189160"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-1934"></span><span>    </span><span id="local-6989586621681189160"><span class="annot"><span class="annottext">ty' :: Type
</span><a href="#local-6989586621681189160"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Identity Type -&gt; Type
forall a. Identity a -&gt; a
</span><a href="../../base/src/Data.Functor.Identity.html#runIdentity"><span class="hs-identifier hs-var hs-var">runIdentity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CpeTyCoEnv -&gt; Type -&gt; Identity Type
</span><a href="GHC.CoreToStg.Prep.html#subst_ty"><span class="hs-identifier hs-var">subst_ty</span></a></span><span> </span><span class="annot"><span class="annottext">CpeTyCoEnv
</span><a href="#local-6989586621681189165"><span class="hs-identifier hs-var">tce</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Identity Type) -&gt; Type -&gt; Identity Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189164"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1935"></span><span>
</span><span id="line-1936"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-1937"></span><span class="hs-comment">-- Cloning binders</span><span>
</span><span id="line-1938"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-1939"></span><span>
</span><span id="line-1940"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-type">cpCloneBndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InVar"><span class="hs-identifier hs-type">InVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#OutVar"><span class="hs-identifier hs-type">OutVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1941"></span><span id="cpCloneBndrs"><span class="annot"><span class="annottext">cpCloneBndrs :: CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndrs"><span class="hs-identifier hs-var hs-var">cpCloneBndrs</span></a></span></span><span> </span><span id="local-6989586621681189156"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189156"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189155"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189155"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id))
-&gt; CorePrepEnv -&gt; [Id] -&gt; UniqSM (CorePrepEnv, [Id])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-var">cpCloneBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189156"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189155"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1942"></span><span>
</span><span id="line-1943"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-type">cpCloneBndr</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#InVar"><span class="hs-identifier hs-type">InVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#CorePrepEnv"><span class="hs-identifier hs-type">CorePrepEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#OutVar"><span class="hs-identifier hs-type">OutVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1944"></span><span id="cpCloneBndr"><span class="annot"><span class="annottext">cpCloneBndr :: CorePrepEnv -&gt; Id -&gt; UniqSM (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpCloneBndr"><span class="hs-identifier hs-var hs-var">cpCloneBndr</span></a></span></span><span> </span><span id="local-6989586621681189154"><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189154"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681189153"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span></span><span>
</span><span id="line-1945"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-1946"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Id) -&gt; UniqSM (CorePrepEnv, Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTyVarBndr"><span class="hs-identifier hs-var">cpSubstTyVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189154"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1947"></span><span>
</span><span id="line-1948"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isCoVar"><span class="hs-identifier hs-var">isCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-1949"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Id) -&gt; UniqSM (CorePrepEnv, Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; (CorePrepEnv, Id)
</span><a href="GHC.CoreToStg.Prep.html#cpSubstCoVarBndr"><span class="hs-identifier hs-var">cpSubstCoVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189154"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1950"></span><span>
</span><span id="line-1951"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1952"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189151"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189151"><span class="hs-identifier hs-var">bndr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; UniqSM Id
forall {m :: * -&gt; *}. MonadUnique m =&gt; Id -&gt; m Id
</span><a href="#local-6989586621681189150"><span class="hs-identifier hs-var">clone_it</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-1953"></span><span>
</span><span id="line-1954"></span><span>       </span><span class="hs-comment">-- Drop (now-useless) rules/unfoldings</span><span>
</span><span id="line-1955"></span><span>       </span><span class="hs-comment">-- See Note [Drop unfoldings and rules]</span><span>
</span><span id="line-1956"></span><span>       </span><span class="hs-comment">-- and Note [Preserve evaluatedness] in GHC.Core.Tidy</span><span>
</span><span id="line-1957"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189149"><span class="annot"><span class="annottext">unfolding' :: Unfolding
</span><a href="#local-6989586621681189149"><span class="hs-identifier hs-var hs-var">unfolding'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unfolding -&gt; Unfolding
</span><a href="GHC.Types.Id.Info.html#zapUnfolding"><span class="hs-identifier hs-var">zapUnfolding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Unfolding
</span><a href="GHC.Types.Id.html#realIdUnfolding"><span class="hs-identifier hs-var">realIdUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1958"></span><span>                          </span><span class="hs-comment">-- Simplifier will set the Id's unfolding</span><span>
</span><span id="line-1959"></span><span>
</span><span id="line-1960"></span><span>             </span><span id="local-6989586621681189146"><span class="annot"><span class="annottext">bndr'' :: Id
</span><a href="#local-6989586621681189146"><span class="hs-identifier hs-var hs-var">bndr''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189151"><span class="hs-identifier hs-var">bndr'</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unfolding -&gt; Id
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span>      </span><span class="annot"><span class="annottext">Unfolding
</span><a href="#local-6989586621681189149"><span class="hs-identifier hs-var">unfolding'</span></a></span><span>
</span><span id="line-1961"></span><span>                            </span><span class="annot"><span class="annottext">Id -&gt; RuleInfo -&gt; Id
</span><a href="GHC.Types.Id.html#setIdSpecialisation"><span class="hs-operator hs-var">`setIdSpecialisation`</span></a></span><span> </span><span class="annot"><span class="annottext">RuleInfo
</span><a href="GHC.Types.Id.Info.html#emptyRuleInfo"><span class="hs-identifier hs-var">emptyRuleInfo</span></a></span><span>
</span><span id="line-1962"></span><span>
</span><span id="line-1963"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CorePrepEnv, Id) -&gt; UniqSM (CorePrepEnv, Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Id -&gt; Id -&gt; CorePrepEnv
</span><a href="GHC.CoreToStg.Prep.html#extendCorePrepEnv"><span class="hs-identifier hs-var">extendCorePrepEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189154"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189153"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189146"><span class="hs-identifier hs-var">bndr''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189146"><span class="hs-identifier hs-var">bndr''</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1964"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1965"></span><span>    </span><span id="local-6989586621681189150"><span class="annot"><span class="annottext">clone_it :: Id -&gt; m Id
</span><a href="#local-6989586621681189150"><span class="hs-identifier hs-var hs-var">clone_it</span></a></span></span><span> </span><span id="local-6989586621681189136"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189136"><span class="hs-identifier hs-var">bndr</span></a></span></span><span>
</span><span id="line-1966"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isLocalId"><span class="hs-identifier hs-var">isLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189136"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-1967"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681189134"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681189134"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-1968"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681189132"><span class="annot"><span class="annottext">ty' :: Type
</span><a href="#local-6989586621681189132"><span class="hs-identifier hs-var hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CorePrepEnv -&gt; Type -&gt; Type
</span><a href="GHC.CoreToStg.Prep.html#cpSubstTy"><span class="hs-identifier hs-var">cpSubstTy</span></a></span><span> </span><span class="annot"><span class="annottext">CorePrepEnv
</span><a href="#local-6989586621681189154"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189136"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1969"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; m Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Id
</span><a href="GHC.Types.Var.html#setVarUnique"><span class="hs-identifier hs-var">setVarUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#setIdType"><span class="hs-identifier hs-var">setIdType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189136"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189132"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681189134"><span class="hs-identifier hs-var">uniq</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1970"></span><span>
</span><span id="line-1971"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-comment">-- Top level things, which we don't want</span><span>
</span><span id="line-1972"></span><span>                    </span><span class="hs-comment">-- to clone, have become GlobalIds by now</span><span>
</span><span id="line-1973"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; m Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189136"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-1974"></span><span>
</span><span id="line-1975"></span><span class="hs-comment">{- Note [Drop unfoldings and rules]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We want to drop the unfolding/rules on every Id:

  - We are now past interface-file generation, and in the
    codegen pipeline, so we really don't need full unfoldings/rules

  - The unfolding/rule may be keeping stuff alive that we'd like
    to discard.  See  Note [Dead code in CorePrep]

  - Getting rid of unnecessary unfoldings reduces heap usage

  - We are changing uniques, so if we didn't discard unfoldings/rules
    we'd have to substitute in them

HOWEVER, we want to preserve evaluated-ness;
see Note [Preserve evaluatedness] in GHC.Core.Tidy.
-}</span><span>
</span><span id="line-1993"></span><span>
</span><span id="line-1994"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-1995"></span><span class="hs-comment">-- Cloning ccall Ids; each must have a unique name,</span><span>
</span><span id="line-1996"></span><span class="hs-comment">-- to give the code generator a handle to hang it on</span><span>
</span><span id="line-1997"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-1998"></span><span>
</span><span id="line-1999"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#fiddleCCall"><span class="hs-identifier hs-type">fiddleCCall</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-2000"></span><span id="fiddleCCall"><span class="annot"><span class="annottext">fiddleCCall :: Id -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#fiddleCCall"><span class="hs-identifier hs-var hs-var">fiddleCCall</span></a></span></span><span> </span><span id="local-6989586621681189129"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189129"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-2001"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isFCallId"><span class="hs-identifier hs-var">isFCallId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189129"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189129"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unique -&gt; Id
</span><a href="GHC.Types.Var.html#setVarUnique"><span class="hs-operator hs-var">`setVarUnique`</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Id) -&gt; UniqSM Unique -&gt; UniqSM Id
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-2002"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; UniqSM Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189129"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-2003"></span><span>
</span><span id="line-2004"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-2005"></span><span class="hs-comment">-- Generating new binders</span><span>
</span><span id="line-2006"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-2007"></span><span>
</span><span id="line-2008"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-type">newVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-2009"></span><span id="newVar"><span class="annot"><span class="annottext">newVar :: Type -&gt; UniqSM Id
</span><a href="GHC.CoreToStg.Prep.html#newVar"><span class="hs-identifier hs-var hs-var">newVar</span></a></span></span><span> </span><span id="local-6989586621681189126"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189126"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-2010"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; ()
</span><a href="GHC.Core.Type.html#seqType"><span class="hs-identifier hs-var">seqType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189126"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; UniqSM Id -&gt; UniqSM Id
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-2011"></span><span>     </span><span id="local-6989586621681189124"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681189124"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqSM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-2012"></span><span>     </span><span class="annot"><span class="annottext">Id -&gt; UniqSM Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Unique -&gt; Type -&gt; Type -&gt; Id
</span><a href="GHC.Types.Id.html#mkSysLocalOrCoVar"><span class="hs-identifier hs-var">mkSysLocalOrCoVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sat&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681189124"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681189126"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2013"></span><span>
</span><span id="line-2014"></span><span>
</span><span id="line-2015"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-2016"></span><span class="hs-comment">-- Floating ticks</span><span>
</span><span id="line-2017"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-2018"></span><span class="hs-comment">--</span><span>
</span><span id="line-2019"></span><span class="hs-comment">-- Note [Floating Ticks in CorePrep]</span><span>
</span><span id="line-2020"></span><span class="hs-comment">--</span><span>
</span><span id="line-2021"></span><span class="hs-comment">-- It might seem counter-intuitive to float ticks by default, given</span><span>
</span><span id="line-2022"></span><span class="hs-comment">-- that we don't actually want to move them if we can help it. On the</span><span>
</span><span id="line-2023"></span><span class="hs-comment">-- other hand, nothing gets very far in CorePrep anyway, and we want</span><span>
</span><span id="line-2024"></span><span class="hs-comment">-- to preserve the order of let bindings and tick annotations in</span><span>
</span><span id="line-2025"></span><span class="hs-comment">-- relation to each other. For example, if we just wrapped let floats</span><span>
</span><span id="line-2026"></span><span class="hs-comment">-- when they pass through ticks, we might end up performing the</span><span>
</span><span id="line-2027"></span><span class="hs-comment">-- following transformation:</span><span>
</span><span id="line-2028"></span><span class="hs-comment">--</span><span>
</span><span id="line-2029"></span><span class="hs-comment">--   src&lt;...&gt; let foo = bar in baz</span><span>
</span><span id="line-2030"></span><span class="hs-comment">--   ==&gt;  let foo = src&lt;...&gt; bar in src&lt;...&gt; baz</span><span>
</span><span id="line-2031"></span><span class="hs-comment">--</span><span>
</span><span id="line-2032"></span><span class="hs-comment">-- Because the let-binding would float through the tick, and then</span><span>
</span><span id="line-2033"></span><span class="hs-comment">-- immediately materialize, achieving nothing but decreasing tick</span><span>
</span><span id="line-2034"></span><span class="hs-comment">-- accuracy. The only special case is the following scenario:</span><span>
</span><span id="line-2035"></span><span class="hs-comment">--</span><span>
</span><span id="line-2036"></span><span class="hs-comment">--   let foo = src&lt;...&gt; (let a = b in bar) in baz</span><span>
</span><span id="line-2037"></span><span class="hs-comment">--   ==&gt;  let foo = src&lt;...&gt; bar; a = src&lt;...&gt; b in baz</span><span>
</span><span id="line-2038"></span><span class="hs-comment">--</span><span>
</span><span id="line-2039"></span><span class="hs-comment">-- Here we would not want the source tick to end up covering &quot;baz&quot; and</span><span>
</span><span id="line-2040"></span><span class="hs-comment">-- therefore refrain from pushing ticks outside. Instead, we copy them</span><span>
</span><span id="line-2041"></span><span class="hs-comment">-- into the floating binds (here &quot;a&quot;) in cpePair. Note that where &quot;b&quot;</span><span>
</span><span id="line-2042"></span><span class="hs-comment">-- or &quot;bar&quot; are (value) lambdas we have to push the annotations</span><span>
</span><span id="line-2043"></span><span class="hs-comment">-- further inside in order to uphold our rules.</span><span>
</span><span id="line-2044"></span><span class="hs-comment">--</span><span>
</span><span id="line-2045"></span><span class="hs-comment">-- All of this is implemented below in @wrapTicks@.</span><span>
</span><span id="line-2046"></span><span>
</span><span id="line-2047"></span><span class="hs-comment">-- | Like wrapFloats, but only wraps tick floats</span><span>
</span><span id="line-2048"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#wrapTicks"><span class="hs-identifier hs-type">wrapTicks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2049"></span><span id="wrapTicks"><span class="annot"><span class="annottext">wrapTicks :: Floats -&gt; CpeRhs -&gt; (Floats, CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#wrapTicks"><span class="hs-identifier hs-var hs-var">wrapTicks</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-type">Floats</span></a></span><span> </span><span id="local-6989586621681189120"><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189120"><span class="hs-identifier hs-var">flag</span></a></span></span><span> </span><span id="local-6989586621681189119"><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189119"><span class="hs-identifier hs-var">floats0</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189118"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189118"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2050"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OkToSpec -&gt; OrdList FloatingBind -&gt; Floats
</span><a href="GHC.CoreToStg.Prep.html#Floats"><span class="hs-identifier hs-var">Floats</span></a></span><span> </span><span class="annot"><span class="annottext">OkToSpec
</span><a href="#local-6989586621681189120"><span class="hs-identifier hs-var">flag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FloatingBind] -&gt; OrdList FloatingBind
forall a. [a] -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#toOL"><span class="hs-identifier hs-var">toOL</span></a></span><span> </span><span class="annot"><span class="annottext">([FloatingBind] -&gt; OrdList FloatingBind)
-&gt; [FloatingBind] -&gt; OrdList FloatingBind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatingBind] -&gt; [FloatingBind]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189115"><span class="hs-identifier hs-var">floats1</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Tickish Id -&gt; CpeRhs -&gt; CpeRhs)
-&gt; CpeRhs -&gt; [Tickish Id] -&gt; CpeRhs
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189118"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Tickish Id] -&gt; [Tickish Id]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189114"><span class="hs-identifier hs-var">ticks1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2051"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189115"><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189115"><span class="hs-identifier hs-var">floats1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189114"><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189114"><span class="hs-identifier hs-var">ticks1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(([FloatingBind], [Tickish Id])
 -&gt; FloatingBind -&gt; ([FloatingBind], [Tickish Id]))
-&gt; ([FloatingBind], [Tickish Id])
-&gt; OrdList FloatingBind
-&gt; ([FloatingBind], [Tickish Id])
forall b a. (b -&gt; a -&gt; b) -&gt; b -&gt; OrdList a -&gt; b
</span><a href="GHC.Data.OrdList.html#foldlOL"><span class="hs-identifier hs-var">foldlOL</span></a></span><span> </span><span class="annot"><span class="annottext">([FloatingBind], [Tickish Id])
-&gt; FloatingBind -&gt; ([FloatingBind], [Tickish Id])
</span><a href="#local-6989586621681189112"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(OrdList FloatingBind -&gt; ([FloatingBind], [Tickish Id]))
-&gt; OrdList FloatingBind -&gt; ([FloatingBind], [Tickish Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList FloatingBind
</span><a href="#local-6989586621681189119"><span class="hs-identifier hs-var">floats0</span></a></span><span>
</span><span id="line-2052"></span><span>        </span><span class="hs-comment">-- Deeply nested constructors will produce long lists of</span><span>
</span><span id="line-2053"></span><span>        </span><span class="hs-comment">-- redundant source note floats here. We need to eliminate</span><span>
</span><span id="line-2054"></span><span>        </span><span class="hs-comment">-- those early, as relying on mkTick to spot it after the fact</span><span>
</span><span id="line-2055"></span><span>        </span><span class="hs-comment">-- can yield O(n^3) complexity [#11095]</span><span>
</span><span id="line-2056"></span><span>        </span><span id="local-6989586621681189112"><span class="annot"><span class="annottext">go :: ([FloatingBind], [Tickish Id])
-&gt; FloatingBind -&gt; ([FloatingBind], [Tickish Id])
</span><a href="#local-6989586621681189112"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189107"><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189107"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189106"><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189106"><span class="hs-identifier hs-var">ticks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatTick"><span class="hs-identifier hs-type">FloatTick</span></a></span><span> </span><span id="local-6989586621681189105"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189105"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-2057"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">tickishPlace</span><span> </span><span class="hs-identifier">t</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">PlaceNonLam</span><span class="hs-special">)</span><span>
</span><span id="line-2058"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189107"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">(Tickish Id -&gt; Bool) -&gt; [Tickish Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Tickish Id -&gt; Tickish Id -&gt; Bool)
-&gt; Tickish Id -&gt; Tickish Id -&gt; Bool
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Tickish Id -&gt; Bool
forall b. Eq b =&gt; Tickish b -&gt; Tickish b -&gt; Bool
</span><a href="GHC.Core.html#tickishContains"><span class="hs-identifier hs-var">tickishContains</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189105"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189106"><span class="hs-identifier hs-var">ticks</span></a></span><span>
</span><span id="line-2059"></span><span>                     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189106"><span class="hs-identifier hs-var">ticks</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189105"><span class="hs-identifier hs-var">t</span></a></span><span class="annot"><span class="annottext">Tickish Id -&gt; [Tickish Id] -&gt; [Tickish Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189106"><span class="hs-identifier hs-var">ticks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2060"></span><span>        </span><span class="annot"><a href="#local-6989586621681189112"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189102"><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189102"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189101"><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189101"><span class="hs-identifier hs-var">ticks</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189100"><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189100"><span class="hs-identifier hs-var">f</span></a></span></span><span>
</span><span id="line-2061"></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Tickish Id -&gt; FloatingBind -&gt; FloatingBind)
-&gt; FloatingBind -&gt; [Tickish Id] -&gt; FloatingBind
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; FloatingBind -&gt; FloatingBind
</span><a href="#local-6989586621681189099"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189100"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Tickish Id] -&gt; [Tickish Id]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189101"><span class="hs-identifier hs-var">ticks</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">FloatingBind -&gt; [FloatingBind] -&gt; [FloatingBind]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[FloatingBind]
</span><a href="#local-6989586621681189102"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681189101"><span class="hs-identifier hs-var">ticks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2062"></span><span>
</span><span id="line-2063"></span><span>        </span><span id="local-6989586621681189099"><span class="annot"><span class="annottext">wrap :: Tickish Id -&gt; FloatingBind -&gt; FloatingBind
</span><a href="#local-6989586621681189099"><span class="hs-identifier hs-var hs-var">wrap</span></a></span></span><span> </span><span id="local-6989586621681189095"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189095"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-type">FloatLet</span></a></span><span> </span><span id="local-6989586621681189094"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189094"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatLet"><span class="hs-identifier hs-var">FloatLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; CoreBind -&gt; CoreBind
</span><a href="#local-6989586621681189093"><span class="hs-identifier hs-var">wrapBind</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189095"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189094"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2064"></span><span>        </span><span class="annot"><a href="#local-6989586621681189099"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span id="local-6989586621681189092"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189092"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-type">FloatCase</span></a></span><span> </span><span id="local-6989586621681189091"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189091"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621681189090"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189090"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681189089"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189089"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681189088"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189088"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621681189087"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189087"><span class="hs-identifier hs-var">ok</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Id -&gt; AltCon -&gt; [Id] -&gt; Bool -&gt; FloatingBind
</span><a href="GHC.CoreToStg.Prep.html#FloatCase"><span class="hs-identifier hs-var">FloatCase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189092"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189091"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189090"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189089"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189088"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681189087"><span class="hs-identifier hs-var">ok</span></a></span><span>
</span><span id="line-2065"></span><span>        </span><span class="annot"><a href="#local-6989586621681189099"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189086"><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189086"><span class="hs-identifier hs-var">other</span></a></span></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; FloatingBind
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;wrapTicks: unexpected float!&quot;</span></span><span>
</span><span id="line-2066"></span><span>                                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatingBind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FloatingBind
</span><a href="#local-6989586621681189086"><span class="hs-identifier hs-var">other</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2067"></span><span>        </span><span id="local-6989586621681189093"><span class="annot"><span class="annottext">wrapBind :: Tickish Id -&gt; CoreBind -&gt; CoreBind
</span><a href="#local-6989586621681189093"><span class="hs-identifier hs-var hs-var">wrapBind</span></a></span></span><span> </span><span id="local-6989586621681189085"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189085"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681189084"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189084"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621681189083"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189083"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CpeRhs -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189084"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189085"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189083"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2068"></span><span>        </span><span class="annot"><a href="#local-6989586621681189093"><span class="hs-identifier hs-var">wrapBind</span></a></span><span> </span><span id="local-6989586621681189082"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189082"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681189081"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189081"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CpeRhs -&gt; CpeRhs) -&gt; [(Id, CpeRhs)] -&gt; [(Id, CpeRhs)]
forall b c a. (b -&gt; c) -&gt; [(a, b)] -&gt; [(a, c)]
</span><a href="GHC.Utils.Misc.html#mapSnd"><span class="hs-identifier hs-var">mapSnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tickish Id -&gt; CpeRhs -&gt; CpeRhs
</span><a href="GHC.Core.Utils.html#mkTick"><span class="hs-identifier hs-var">mkTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621681189082"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189081"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2069"></span><span>
</span><span id="line-2070"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-2071"></span><span class="hs-comment">-- Collecting cost centres</span><span>
</span><span id="line-2072"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-2073"></span><span>
</span><span id="line-2074"></span><span class="hs-comment">-- | Collect cost centres defined in the current module, including those in</span><span>
</span><span id="line-2075"></span><span class="hs-comment">-- unfoldings.</span><span>
</span><span id="line-2076"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#collectCostCentres"><span class="hs-identifier hs-type">collectCostCentres</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">S.Set</span></a></span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span>
</span><span id="line-2077"></span><span id="collectCostCentres"><span class="annot"><span class="annottext">collectCostCentres :: Module -&gt; CoreProgram -&gt; Set CostCentre
</span><a href="GHC.CoreToStg.Prep.html#collectCostCentres"><span class="hs-identifier hs-var hs-var">collectCostCentres</span></a></span></span><span> </span><span id="local-6989586621681189079"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681189079"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span>
</span><span id="line-2078"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Set CostCentre -&gt; CoreBind -&gt; Set CostCentre)
-&gt; Set CostCentre -&gt; CoreProgram -&gt; Set CostCentre
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CoreBind -&gt; Set CostCentre
</span><a href="#local-6989586621681189077"><span class="hs-identifier hs-var">go_bind</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
forall a. Set a
</span><a href="../../containers/src/Data.Set.Internal.html#empty"><span class="hs-identifier hs-var">S.empty</span></a></span><span>
</span><span id="line-2079"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-2080"></span><span>    </span><span id="local-6989586621681189073"><span class="annot"><span class="annottext">go :: Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621681189072"><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span id="local-6989586621681189071"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189071"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189071"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2081"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-2082"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-2083"></span><span>      </span><span class="annot"><a href="GHC.Core.html#App"><span class="hs-identifier hs-type">App</span></a></span><span> </span><span id="local-6989586621681189070"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189070"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span id="local-6989586621681189069"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189069"><span class="hs-identifier hs-var">e2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189070"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189069"><span class="hs-identifier hs-var">e2</span></a></span><span>
</span><span id="line-2084"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-type">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189068"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189068"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189068"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2085"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Let"><span class="hs-identifier hs-type">Let</span></a></span><span> </span><span id="local-6989586621681189067"><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189067"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681189066"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189066"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre -&gt; CoreBind -&gt; Set CostCentre
</span><a href="#local-6989586621681189077"><span class="hs-identifier hs-var">go_bind</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681189067"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189066"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2086"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621681189065"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189065"><span class="hs-identifier hs-var">scrt</span></a></span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189064"><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189064"><span class="hs-identifier hs-var">alts</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; [Alt Id] -&gt; Set CostCentre
</span><a href="#local-6989586621681189063"><span class="hs-identifier hs-var">go_alts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189065"><span class="hs-identifier hs-var">scrt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Alt Id]
</span><a href="#local-6989586621681189064"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-2087"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Cast"><span class="hs-identifier hs-type">Cast</span></a></span><span> </span><span id="local-6989586621681189062"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189062"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189062"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2088"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#ProfNote"><span class="hs-identifier hs-type">ProfNote</span></a></span><span> </span><span id="local-6989586621681189060"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681189060"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681189059"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189059"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-2089"></span><span>        </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; Module -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#ccFromThisModule"><span class="hs-identifier hs-var">ccFromThisModule</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681189060"><span class="hs-identifier hs-var">cc</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681189079"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; Set CostCentre -&gt; Set CostCentre
forall a. Ord a =&gt; a -&gt; Set a -&gt; Set a
</span><a href="../../containers/src/Data.Set.Internal.html#insert"><span class="hs-identifier hs-var">S.insert</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681189060"><span class="hs-identifier hs-var">cc</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189059"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2090"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681189057"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189057"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189057"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2091"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-2092"></span><span>      </span><span class="annot"><a href="GHC.Core.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189072"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-2093"></span><span>
</span><span id="line-2094"></span><span>    </span><span id="local-6989586621681189063"><span class="annot"><span class="annottext">go_alts :: Set CostCentre -&gt; [Alt Id] -&gt; Set CostCentre
</span><a href="#local-6989586621681189063"><span class="hs-identifier hs-var hs-var">go_alts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Set CostCentre -&gt; Alt Id -&gt; Set CostCentre)
-&gt; Set CostCentre -&gt; [Alt Id] -&gt; Set CostCentre
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681189056"><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189056"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189055"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681189055"><span class="hs-identifier hs-var">_con</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189054"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681189054"><span class="hs-identifier hs-var">_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189053"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189053"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189056"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189053"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2095"></span><span>
</span><span id="line-2096"></span><span>    </span><span class="annot"><a href="#local-6989586621681189077"><span class="hs-identifier hs-type">go_bind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">S.Set</span></a></span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">S.Set</span></a></span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span>
</span><span id="line-2097"></span><span>    </span><span id="local-6989586621681189077"><span class="annot"><span class="annottext">go_bind :: Set CostCentre -&gt; CoreBind -&gt; Set CostCentre
</span><a href="#local-6989586621681189077"><span class="hs-identifier hs-var hs-var">go_bind</span></a></span></span><span> </span><span id="local-6989586621681189052"><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189052"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681189051"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189051"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681189050"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189050"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2098"></span><span>      </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre
-&gt; (CpeRhs -&gt; Set CostCentre) -&gt; Maybe CpeRhs -&gt; Set CostCentre
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189052"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189052"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189048"><span class="hs-identifier hs-var">get_unf</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189051"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189050"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-2099"></span><span>    </span><span class="annot"><a href="#local-6989586621681189077"><span class="hs-identifier hs-var">go_bind</span></a></span><span> </span><span id="local-6989586621681189047"><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189047"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681189046"><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189046"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2100"></span><span>      </span><span class="annot"><span class="annottext">(Set CostCentre -&gt; (Id, CpeRhs) -&gt; Set CostCentre)
-&gt; Set CostCentre -&gt; [(Id, CpeRhs)] -&gt; Set CostCentre
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681189045"><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189045"><span class="hs-identifier hs-var">cs'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681189044"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189044"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681189043"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189043"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre
-&gt; (CpeRhs -&gt; Set CostCentre) -&gt; Maybe CpeRhs -&gt; Set CostCentre
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189045"><span class="hs-identifier hs-var">cs'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set CostCentre -&gt; CpeRhs -&gt; Set CostCentre
</span><a href="#local-6989586621681189073"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189045"><span class="hs-identifier hs-var">cs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189048"><span class="hs-identifier hs-var">get_unf</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189044"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681189043"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Set CostCentre
</span><a href="#local-6989586621681189047"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CpeRhs)]
</span><a href="#local-6989586621681189046"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-2101"></span><span>
</span><span id="line-2102"></span><span>    </span><span class="hs-comment">-- Unfoldings may have cost centres that in the original definion are</span><span>
</span><span id="line-2103"></span><span>    </span><span class="hs-comment">-- optimized away, see #5889.</span><span>
</span><span id="line-2104"></span><span>    </span><span id="local-6989586621681189048"><span class="annot"><span class="annottext">get_unf :: Id -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189048"><span class="hs-identifier hs-var hs-var">get_unf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unfolding -&gt; Maybe CpeRhs
</span><a href="GHC.Core.html#maybeUnfoldingTemplate"><span class="hs-identifier hs-var">maybeUnfoldingTemplate</span></a></span><span> </span><span class="annot"><span class="annottext">(Unfolding -&gt; Maybe CpeRhs)
-&gt; (Id -&gt; Unfolding) -&gt; Id -&gt; Maybe CpeRhs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Unfolding
</span><a href="GHC.Types.Id.html#realIdUnfolding"><span class="hs-identifier hs-var">realIdUnfolding</span></a></span><span>
</span><span id="line-2105"></span><span>
</span><span id="line-2106"></span><span>
</span><span id="line-2107"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-2108"></span><span class="hs-comment">-- Numeric literals</span><span>
</span><span id="line-2109"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-2110"></span><span>
</span><span id="line-2111"></span><span class="hs-comment">-- | Create a function that converts Bignum literals into their final CoreExpr</span><span>
</span><span id="line-2112"></span><span class="annot"><a href="GHC.CoreToStg.Prep.html#mkConvertNumLiteral"><span class="hs-identifier hs-type">mkConvertNumLiteral</span></a></span><span>
</span><span id="line-2113"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-2114"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumType"><span class="hs-identifier hs-type">LitNumType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2115"></span><span id="mkConvertNumLiteral"><span class="annot"><span class="annottext">mkConvertNumLiteral :: HscEnv -&gt; IO (LitNumType -&gt; Integer -&gt; Maybe CpeRhs)
</span><a href="GHC.CoreToStg.Prep.html#mkConvertNumLiteral"><span class="hs-identifier hs-var hs-var">mkConvertNumLiteral</span></a></span></span><span> </span><span id="local-6989586621681189041"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189041"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-2116"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-2117"></span><span>      </span><span id="local-6989586621681189040"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681189040"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189041"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-2118"></span><span>      </span><span id="local-6989586621681189039"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189040"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-2119"></span><span>      </span><span id="local-6989586621681189031"><span class="annot"><span class="annottext">guardBignum :: m a -&gt; m a
</span><a href="#local-6989586621681189031"><span class="hs-identifier hs-var hs-var">guardBignum</span></a></span></span><span> </span><span id="local-6989586621681189030"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681189030"><span class="hs-identifier hs-var">act</span></a></span></span><span>
</span><span id="line-2120"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitId
</span><a href="GHC.Driver.Session.html#homeUnitId"><span class="hs-identifier hs-var hs-var">homeUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189040"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; UnitId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#primUnitId"><span class="hs-identifier hs-var">primUnitId</span></a></span><span>
</span><span id="line-2121"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Bignum literals are not supported in ghc-prim&quot;</span></span><span>
</span><span id="line-2122"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitId
</span><a href="GHC.Driver.Session.html#homeUnitId"><span class="hs-identifier hs-var hs-var">homeUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189040"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; UnitId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#bignumUnitId"><span class="hs-identifier hs-var">bignumUnitId</span></a></span><span>
</span><span id="line-2123"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Bignum literals are not supported in ghc-bignum&quot;</span></span><span>
</span><span id="line-2124"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621681189030"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-2125"></span><span>
</span><span id="line-2126"></span><span>      </span><span id="local-6989586621681189022"><span class="annot"><span class="annottext">lookupBignumId :: Name -&gt; IO Id
</span><a href="#local-6989586621681189022"><span class="hs-identifier hs-var hs-var">lookupBignumId</span></a></span></span><span> </span><span id="local-6989586621681189021"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681189021"><span class="hs-identifier hs-var">n</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Id -&gt; IO Id
forall {m :: * -&gt; *} {a}. Monad m =&gt; m a -&gt; m a
</span><a href="#local-6989586621681189031"><span class="hs-identifier hs-var">guardBignum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; TyThing -&gt; Id
TyThing -&gt; Id
</span><a href="GHC.Driver.Types.html#tyThingId"><span class="hs-identifier hs-var">tyThingId</span></a></span><span> </span><span class="annot"><span class="annottext">(TyThing -&gt; Id) -&gt; IO TyThing -&gt; IO Id
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; Name -&gt; IO TyThing
</span><a href="GHC.Tc.Utils.Env.html#lookupGlobal"><span class="hs-identifier hs-var">lookupGlobal</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681189041"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681189021"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2127"></span><span>
</span><span id="line-2128"></span><span>   </span><span class="hs-comment">-- The lookup is done here but the failure (panic) is reported lazily when we</span><span>
</span><span id="line-2129"></span><span>   </span><span class="hs-comment">-- try to access the `bigNatFromWordList` function.</span><span>
</span><span id="line-2130"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-2131"></span><span>   </span><span class="hs-comment">-- If we ever get built-in ByteArray# literals, we could avoid the lookup by</span><span>
</span><span id="line-2132"></span><span>   </span><span class="hs-comment">-- directly using the Integer/Natural wired-in constructors for big numbers.</span><span>
</span><span id="line-2133"></span><span>
</span><span id="line-2134"></span><span>   </span><span id="local-6989586621681189018"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189018"><span class="hs-identifier hs-var">bignatFromWordListId</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; IO Id
</span><a href="#local-6989586621681189022"><span class="hs-identifier hs-var">lookupBignumId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#bignatFromWordListName"><span class="hs-identifier hs-var">bignatFromWordListName</span></a></span><span>
</span><span id="line-2135"></span><span>
</span><span id="line-2136"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-2137"></span><span>      </span><span id="local-6989586621681189016"><span class="annot"><span class="annottext">convertNumLit :: LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189016"><span class="hs-identifier hs-var hs-var">convertNumLit</span></a></span></span><span> </span><span id="local-6989586621681189015"><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681189015"><span class="hs-identifier hs-var">nt</span></a></span></span><span> </span><span id="local-6989586621681189014"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189014"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="#local-6989586621681189015"><span class="hs-identifier hs-var">nt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-2138"></span><span>         </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInteger"><span class="hs-identifier hs-var">LitNumInteger</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Maybe CpeRhs
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; CpeRhs
</span><a href="#local-6989586621681189012"><span class="hs-identifier hs-var">convertInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189014"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2139"></span><span>         </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumNatural"><span class="hs-identifier hs-var">LitNumNatural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; Maybe CpeRhs
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; CpeRhs
</span><a href="#local-6989586621681189010"><span class="hs-identifier hs-var">convertNatural</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189014"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2140"></span><span>         </span><span class="annot"><span class="annottext">LitNumType
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe CpeRhs
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2141"></span><span>
</span><span id="line-2142"></span><span>      </span><span id="local-6989586621681189012"><span class="annot"><span class="annottext">convertInteger :: Integer -&gt; CpeRhs
</span><a href="#local-6989586621681189012"><span class="hs-identifier hs-var hs-var">convertInteger</span></a></span></span><span> </span><span id="local-6989586621681189007"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189007"><span class="hs-identifier hs-var">i</span></a></span></span><span>
</span><span id="line-2143"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformInIntRange"><span class="hs-identifier hs-var">platformInIntRange</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189007"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-comment">-- fit in a Int#</span><span>
</span><span id="line-2144"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CpeRhs] -&gt; CpeRhs
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerISDataCon"><span class="hs-identifier hs-var">integerISDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Literal -&gt; CpeRhs
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitInt"><span class="hs-identifier hs-var">mkLitInt</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189007"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-2145"></span><span>
</span><span id="line-2146"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-comment">-- build a BigNat and embed into IN or IP</span><span>
</span><span id="line-2147"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681188999"><span class="annot"><span class="annottext">con :: DataCon
</span><a href="#local-6989586621681188999"><span class="hs-identifier hs-var hs-var">con</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189007"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerIPDataCon"><span class="hs-identifier hs-var">integerIPDataCon</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#integerINDataCon"><span class="hs-identifier hs-var">integerINDataCon</span></a></span><span>
</span><span id="line-2148"></span><span>           </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; CpeRhs -&gt; CpeRhs
</span><a href="#local-6989586621681188995"><span class="hs-identifier hs-var">mkBigNum</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681188999"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; CpeRhs
</span><a href="#local-6989586621681188994"><span class="hs-identifier hs-var">convertBignatPrim</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#abs"><span class="hs-identifier hs-var">abs</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681189007"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2149"></span><span>
</span><span id="line-2150"></span><span>      </span><span id="local-6989586621681189010"><span class="annot"><span class="annottext">convertNatural :: Integer -&gt; CpeRhs
</span><a href="#local-6989586621681189010"><span class="hs-identifier hs-var hs-var">convertNatural</span></a></span></span><span> </span><span id="local-6989586621681188992"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188992"><span class="hs-identifier hs-var">i</span></a></span></span><span>
</span><span id="line-2151"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformInWordRange"><span class="hs-identifier hs-var">platformInWordRange</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188992"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-comment">-- fit in a Word#</span><span>
</span><span id="line-2152"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CpeRhs] -&gt; CpeRhs
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#naturalNSDataCon"><span class="hs-identifier hs-var">naturalNSDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Literal -&gt; CpeRhs
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWord"><span class="hs-identifier hs-var">mkLitWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188992"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-2153"></span><span>
</span><span id="line-2154"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-comment">--build a BigNat and embed into NB</span><span>
</span><span id="line-2155"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; CpeRhs -&gt; CpeRhs
</span><a href="#local-6989586621681188995"><span class="hs-identifier hs-var">mkBigNum</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#naturalNBDataCon"><span class="hs-identifier hs-var">naturalNBDataCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; CpeRhs
</span><a href="#local-6989586621681188994"><span class="hs-identifier hs-var">convertBignatPrim</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188992"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2156"></span><span>
</span><span id="line-2157"></span><span>      </span><span class="hs-comment">-- we can't simply generate:</span><span>
</span><span id="line-2158"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-2159"></span><span>      </span><span class="hs-comment">--    NB (bigNatFromWordList# [W# 10, W# 20])</span><span>
</span><span id="line-2160"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-2161"></span><span>      </span><span class="hs-comment">-- using `mkConApp` because it isn't in ANF form. Instead we generate:</span><span>
</span><span id="line-2162"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-2163"></span><span>      </span><span class="hs-comment">--    case bigNatFromWordList# [W# 10, W# 20] of ba { DEFAULT -&gt; NB ba }</span><span>
</span><span id="line-2164"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-2165"></span><span>      </span><span class="hs-comment">-- via `mkCoreApps`</span><span>
</span><span id="line-2166"></span><span>
</span><span id="line-2167"></span><span>      </span><span id="local-6989586621681188995"><span class="annot"><span class="annottext">mkBigNum :: DataCon -&gt; CpeRhs -&gt; CpeRhs
</span><a href="#local-6989586621681188995"><span class="hs-identifier hs-var hs-var">mkBigNum</span></a></span></span><span> </span><span id="local-6989586621681188987"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681188987"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681188986"><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681188986"><span class="hs-identifier hs-var">ba</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [CpeRhs] -&gt; CpeRhs
</span><a href="GHC.Core.Make.html#mkCoreApps"><span class="hs-identifier hs-var">mkCoreApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Id
</span><a href="GHC.Core.DataCon.html#dataConWorkId"><span class="hs-identifier hs-var">dataConWorkId</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681188987"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681188986"><span class="hs-identifier hs-var">ba</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2168"></span><span>
</span><span id="line-2169"></span><span>      </span><span id="local-6989586621681188994"><span class="annot"><span class="annottext">convertBignatPrim :: Integer -&gt; CpeRhs
</span><a href="#local-6989586621681188994"><span class="hs-identifier hs-var hs-var">convertBignatPrim</span></a></span></span><span> </span><span id="local-6989586621681188984"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188984"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-2170"></span><span>         </span><span class="hs-keyword">let</span><span>
</span><span id="line-2171"></span><span>            </span><span id="local-6989586621681188983"><span class="annot"><span class="annottext">target :: Platform
</span><a href="#local-6989586621681188983"><span class="hs-identifier hs-var hs-var">target</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681189040"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-2172"></span><span>
</span><span id="line-2173"></span><span>            </span><span class="hs-comment">-- ByteArray# literals aren't supported (yet). Were they supported,</span><span>
</span><span id="line-2174"></span><span>            </span><span class="hs-comment">-- we would use them directly. We would need to handle</span><span>
</span><span id="line-2175"></span><span>            </span><span class="hs-comment">-- wordSize/endianness conversion between host and target</span><span>
</span><span id="line-2176"></span><span>            </span><span class="hs-comment">-- wordSize  = platformWordSize platform</span><span>
</span><span id="line-2177"></span><span>            </span><span class="hs-comment">-- byteOrder = platformByteOrder platform</span><span>
</span><span id="line-2178"></span><span>
</span><span id="line-2179"></span><span>            </span><span class="hs-comment">-- For now we build a list of Words and we produce</span><span>
</span><span id="line-2180"></span><span>            </span><span class="hs-comment">-- `bigNatFromWordList# list_of_words`</span><span>
</span><span id="line-2181"></span><span>
</span><span id="line-2182"></span><span>            </span><span id="local-6989586621681188982"><span class="annot"><span class="annottext">words :: CpeRhs
</span><a href="#local-6989586621681188982"><span class="hs-identifier hs-var hs-var">words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [CpeRhs] -&gt; CpeRhs
</span><a href="GHC.Core.Make.html#mkListExpr"><span class="hs-identifier hs-var">mkListExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#wordTy"><span class="hs-identifier hs-var">wordTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CpeRhs] -&gt; [CpeRhs]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Integer -&gt; Maybe (CpeRhs, Integer)) -&gt; Integer -&gt; [CpeRhs]
forall b a. (b -&gt; Maybe (a, b)) -&gt; b -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier hs-var">unfoldr</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Maybe (CpeRhs, Integer)
forall {b}. Integer -&gt; Maybe (Expr b, Integer)
</span><a href="#local-6989586621681188979"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188984"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-2183"></span><span>               </span><span class="hs-keyword">where</span><span>
</span><span id="line-2184"></span><span>                  </span><span id="local-6989586621681188979"><span class="annot"><span class="annottext">f :: Integer -&gt; Maybe (Expr b, Integer)
</span><a href="#local-6989586621681188979"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Expr b, Integer)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-2185"></span><span>                  </span><span class="annot"><a href="#local-6989586621681188979"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span id="local-6989586621681188975"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188975"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681188972"><span class="annot"><span class="annottext">low :: Integer
</span><a href="#local-6989586621681188972"><span class="hs-identifier hs-var hs-var">low</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188975"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188970"><span class="hs-identifier hs-var">mask</span></a></span><span>
</span><span id="line-2186"></span><span>                            </span><span id="local-6989586621681188968"><span class="annot"><span class="annottext">high :: Integer
</span><a href="#local-6989586621681188968"><span class="hs-identifier hs-var hs-var">high</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188975"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Integer
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681188966"><span class="hs-identifier hs-var">bits</span></a></span><span>
</span><span id="line-2187"></span><span>                        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(Expr b, Integer) -&gt; Maybe (Expr b, Integer)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [Expr b] -&gt; Expr b
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#wordDataCon"><span class="hs-identifier hs-var">wordDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Literal -&gt; Expr b
forall b. Literal -&gt; Expr b
</span><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-var">Lit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitWord"><span class="hs-identifier hs-var">mkLitWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681189039"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188972"><span class="hs-identifier hs-var">low</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681188968"><span class="hs-identifier hs-var">high</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-2188"></span><span>                  </span><span id="local-6989586621681188966"><span class="annot"><span class="annottext">bits :: Int
</span><a href="#local-6989586621681188966"><span class="hs-identifier hs-var hs-var">bits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBits"><span class="hs-identifier hs-var">platformWordSizeInBits</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681188983"><span class="hs-identifier hs-var">target</span></a></span><span>
</span><span id="line-2189"></span><span>                  </span><span id="local-6989586621681188970"><span class="annot"><span class="annottext">mask :: Integer
</span><a href="#local-6989586621681188970"><span class="hs-identifier hs-var hs-var">mask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int -&gt; Integer
forall a b. (Num a, Integral b) =&gt; a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Real.html#%5E"><span class="hs-operator hs-var">^</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681188966"><span class="hs-identifier hs-var">bits</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span>
</span><span id="line-2190"></span><span>
</span><span id="line-2191"></span><span>         </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CpeRhs -&gt; [CpeRhs] -&gt; CpeRhs
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; CpeRhs
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681189018"><span class="hs-identifier hs-var">bignatFromWordListId</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CpeRhs
</span><a href="#local-6989586621681188982"><span class="hs-identifier hs-var">words</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-2192"></span><span>
</span><span id="line-2193"></span><span>
</span><span id="line-2194"></span><span>   </span><span class="annot"><span class="annottext">(LitNumType -&gt; Integer -&gt; Maybe CpeRhs)
-&gt; IO (LitNumType -&gt; Integer -&gt; Maybe CpeRhs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Maybe CpeRhs
</span><a href="#local-6989586621681189016"><span class="hs-identifier hs-var">convertNumLit</span></a></span><span>
</span><span id="line-2195"></span><span>
</span><span id="line-2196"></span></pre></body></html>